(fp: IO[bytes], length: int)
| 759 | |
| 760 | |
| 761 | def must_read(fp: IO[bytes], length: int) -> bytes: |
| 762 | ret = fp.read(length) |
| 763 | if len(ret) < length: |
| 764 | raise Exception("unexpectedly reached end of file") |
| 765 | return ret |
| 766 | |
| 767 | |
| 768 | @functools.lru_cache(maxsize=None) |