MCPcopy
hub / github.com/pallets/werkzeug / start_file_streaming

Method start_file_streaming

src/werkzeug/formparser.py:333–349  ·  view source on GitHub ↗
(
        self, event: File, total_content_length: int | None
    )

Source from the content-addressed store, hash-verified

331 return "utf-8"
332
333 def start_file_streaming(
334 self, event: File, total_content_length: int | None
335 ) -> t.IO[bytes]:
336 content_type = event.headers.get("content-type")
337
338 try:
339 content_length = _plain_int(event.headers["content-length"])
340 except (KeyError, ValueError):
341 content_length = 0
342
343 container = self.stream_factory(
344 total_content_length=total_content_length,
345 filename=event.filename,
346 content_type=content_type,
347 content_length=content_length,
348 )
349 return container
350
351 def parse(
352 self, stream: t.IO[bytes], boundary: bytes, content_length: int | None

Callers 1

parseMethod · 0.95

Calls 3

_plain_intFunction · 0.85
stream_factoryMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected