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

Method _safe_readinto

Lib/http/client.py:670–676  ·  view source on GitHub ↗

Same as _safe_read, but for reading into a buffer.

(self, b)

Source from the content-addressed store, hash-verified

668 raise IncompleteRead(data.getvalue(), amt - data.tell())
669
670 def _safe_readinto(self, b):
671 """Same as _safe_read, but for reading into a buffer."""
672 amt = len(b)
673 n = self.fp.readinto(b)
674 if n < amt:
675 raise IncompleteRead(bytes(b[:n]), amt-n)
676 return n
677
678 def read1(self, n=-1):
679 """Read with at most one underlying system call. If at least one

Callers 1

_readinto_chunkedMethod · 0.95

Calls 2

IncompleteReadClass · 0.85
readintoMethod · 0.45

Tested by

no test coverage detected