MCPcopy
hub / github.com/urllib3/urllib3 / IncompleteRead

Class IncompleteRead

src/urllib3/exceptions.py:261–280  ·  view source on GitHub ↗

Response length doesn't match expected Content-Length Subclass of :class:`http.client.IncompleteRead` to allow int value for ``partial`` to avoid creating large objects on streamed reads.

Source from the content-addressed store, hash-verified

259
260
261class IncompleteRead(HTTPError, httplib_IncompleteRead):
262 """
263 Response length doesn't match expected Content-Length
264
265 Subclass of :class:`http.client.IncompleteRead` to allow int value
266 for ``partial`` to avoid creating large objects on streamed reads.
267 """
268
269 partial: int # type: ignore[assignment]
270 expected: int
271
272 def __init__(self, partial: int, expected: int) -> None:
273 self.partial = partial
274 self.expected = expected
275
276 def __repr__(self) -> str:
277 return "IncompleteRead(%i bytes read, %i more expected)" % (
278 self.partial,
279 self.expected,
280 )
281
282
283class InvalidChunkLength(HTTPError, httplib_IncompleteRead):

Callers 1

_raw_readMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected