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

Function _read_exact

Lib/gzip.py:471–484  ·  view source on GitHub ↗

Read exactly *n* bytes from `fp` This method is required because fp may be unbuffered, i.e. return short reads.

(fp, n)

Source from the content-addressed store, hash-verified

469 super().__del__()
470
471def _read_exact(fp, n):
472 '''Read exactly *n* bytes from `fp`
473
474 This method is required because fp may be unbuffered,
475 i.e. return short reads.
476 '''
477 data = fp.read(n)
478 while len(data) < n:
479 b = fp.read(n - len(data))
480 if not b:
481 raise EOFError("Compressed file ended before the "
482 "end-of-stream marker was reached")
483 data += b
484 return data
485
486
487def _read_gzip_header(fp):

Callers 2

_read_gzip_headerFunction · 0.85
_read_eofMethod · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…