MCPcopy Index your code
hub / github.com/python/cpython / _read1_chunked

Method _read1_chunked

Lib/http/client.py:723–735  ·  view source on GitHub ↗
(self, n)

Source from the content-addressed store, hash-verified

721 return result
722
723 def _read1_chunked(self, n):
724 # Strictly speaking, _get_chunk_left() may cause more than one read,
725 # but that is ok, since that is to satisfy the chunked protocol.
726 chunk_left = self._get_chunk_left()
727 if chunk_left is None or n == 0:
728 return b''
729 if not (0 <= n <= chunk_left):
730 n = chunk_left # if n is negative or larger than chunk_left
731 read = self.fp.read1(n)
732 self.chunk_left -= len(read)
733 if not read:
734 raise IncompleteRead(b"")
735 return read
736
737 def _peek_chunked(self, n):
738 # Strictly speaking, _get_chunk_left() may cause more than one read,

Callers 1

read1Method · 0.95

Calls 3

_get_chunk_leftMethod · 0.95
IncompleteReadClass · 0.85
read1Method · 0.45

Tested by

no test coverage detected