(fp: IO[bytes], length: int)
| 729 | |
| 730 | |
| 731 | def must_read(fp: IO[bytes], length: int) -> bytes: |
| 732 | ret = fp.read(length) |
| 733 | if len(ret) < length: |
| 734 | raise Exception("unexpectedly reached end of file") |
| 735 | return ret |
| 736 | |
| 737 | |
| 738 | @functools.lru_cache(maxsize=None) |