diff options
| author | Gregory P. Smith <greg@mad-scientist.com> | 2008-03-19 22:23:51 (GMT) | 
|---|---|---|
| committer | Gregory P. Smith <greg@mad-scientist.com> | 2008-03-19 22:23:51 (GMT) | 
| commit | f15cde3732c64c2fa246cae2fd6a3a4589e0d987 (patch) | |
| tree | 69cc1caf75a0bc5f91c295a0c261561b18554c03 /Lib/gzip.py | |
| parent | e7abf20ce757bd8d088c9b1519066786e9b8439b (diff) | |
| download | cpython-f15cde3732c64c2fa246cae2fd6a3a4589e0d987.zip cpython-f15cde3732c64c2fa246cae2fd6a3a4589e0d987.tar.gz cpython-f15cde3732c64c2fa246cae2fd6a3a4589e0d987.tar.bz2  | |
Improve the error message when the CRCs don't match.
Diffstat (limited to 'Lib/gzip.py')
| -rw-r--r-- | Lib/gzip.py | 3 | 
1 files changed, 2 insertions, 1 deletions
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 @@ 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"  | 
