From: Gregory P. Smith Date: Wed, 19 Mar 2008 22:23:51 +0000 (+0000) Subject: Improve the error message when the CRCs don't match. X-Git-Tag: v2.6a2~216 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f15cde3732c64c2fa246cae2fd6a3a4589e0d987;p=thirdparty%2FPython%2Fcpython.git Improve the error message when the CRCs don't match. --- diff --git a/Lib/gzip.py b/Lib/gzip.py index d85ba2b49f7e..5d8761ebf379 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -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"