MCPcopy Index your code
hub / github.com/RustPython/RustPython / _read1_chunked

Method _read1_chunked

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

Source from the content-addressed store, hash-verified

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

Callers 1

read1Method · 0.95

Calls 4

_get_chunk_leftMethod · 0.95
lenFunction · 0.85
IncompleteReadClass · 0.85
read1Method · 0.45

Tested by

no test coverage detected