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

Function _read_exact

Lib/gzip.py:473–486  ·  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

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

Callers 2

_read_gzip_headerFunction · 0.85
_read_eofMethod · 0.85

Calls 2

lenFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected