Improve the error message when the CRCs don't match.
This commit is contained in:
parent
e7abf20ce7
commit
f15cde3732
|
@ -316,7 +316,8 @@ class GzipFile:
|
|||
crc32 = read32(self.fileobj)
|
||||
isize = U32(read32(self.fileobj)) # may exceed 2GB
|
||||
if U32(crc32) != U32(self.crc):
|
||||
raise IOError, "CRC check failed"
|
||||
raise IOError("CRC check failed %s != %s" % (hex(U32(crc32)),
|
||||
hex(U32(self.crc))))
|
||||
elif isize != LOWU32(self.size):
|
||||
raise IOError, "Incorrect length of data produced"
|
||||
|
||||
|
|
Loading…
Reference in New Issue