Don't attempt to decode magic bytes

Since they're wrong, they're likely not decodable anyways.
This commit is contained in:
Jan Petykiewicz 2021-07-21 01:10:33 -07:00
parent 25fe2067cd
commit a64f2726d0

View File

@ -2230,4 +2230,4 @@ def read_magic_bytes(stream: io.BufferedIOBase):
magic = _read(stream, len(MAGIC_BYTES)) magic = _read(stream, len(MAGIC_BYTES))
if magic != MAGIC_BYTES: if magic != MAGIC_BYTES:
raise InvalidDataError('Could not read magic bytes, ' raise InvalidDataError('Could not read magic bytes, '
'found {!r} : {}'.format(magic, magic.decode())) 'found {!r}'.format(magic))