MCPcopy
hub / github.com/urllib3/urllib3 / chunk_readable

Function chunk_readable

src/urllib3/util/request.py:230–238  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

228 elif hasattr(body, "read"):
229
230 def chunk_readable() -> typing.Iterable[bytes]:
231 encode = isinstance(body, io.TextIOBase)
232 while True:
233 datablock = body.read(blocksize)
234 if not datablock:
235 break
236 if encode:
237 datablock = datablock.encode("utf-8")
238 yield datablock
239
240 chunks = chunk_readable()
241 content_length = None

Callers 1

body_to_chunksFunction · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected