commit | f15cde3732c64c2fa246cae2fd6a3a4589e0d987 | [log] [tgz] |
---|---|---|
author | Gregory P. Smith <greg@mad-scientist.com> | Wed Mar 19 22:23:51 2008 +0000 |
committer | Gregory P. Smith <greg@mad-scientist.com> | Wed Mar 19 22:23:51 2008 +0000 |
tree | 69cc1caf75a0bc5f91c295a0c261561b18554c03 | |
parent | e7abf20ce757bd8d088c9b1519066786e9b8439b [diff] [blame] |
Improve the error message when the CRCs don't match.
diff --git a/Lib/gzip.py b/Lib/gzip.py index d85ba2b..5d8761e 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py
@@ -316,7 +316,8 @@ 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"