mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
3e1a6e252e
commit
c8fbdb110b
@ -732,10 +732,7 @@ class ZipExtFile(io.BufferedIOBase):
|
||||
return raw
|
||||
|
||||
def check_crc(self, raw: bytes) -> None:
|
||||
if self._expected_crc is not None:
|
||||
crc = crc32(raw) & 0xffffffff
|
||||
# Check the CRC if we're at the end of the file
|
||||
if crc != self._expected_crc:
|
||||
if self._expected_crc is not None and (crc32(raw) & 0xffffffff) != self._expected_crc:
|
||||
raise BadZipfile(f'Bad CRC-32 for file {self.name!r}')
|
||||
|
||||
def readall(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user