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

Function _chunk_iter

src/werkzeug/formparser.py:418–430  ·  view source on GitHub ↗

Read data in chunks for multipart/form-data parsing. Stop if no data is read. Yield ``None`` at the end to signal end of parsing.

(read: t.Callable[[int], bytes], size: int)

Source from the content-addressed store, hash-verified

416
417
418def _chunk_iter(read: t.Callable[[int], bytes], size: int) -> t.Iterator[bytes | None]:
419 """Read data in chunks for multipart/form-data parsing. Stop if no data is read.
420 Yield ``None`` at the end to signal end of parsing.
421 """
422 while True:
423 data = read(size)
424
425 if not data:
426 break
427
428 yield data
429
430 yield None

Callers 1

parseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected