summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-03-23 23:43:02 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-03-23 23:43:02 (GMT)
commitac830e932df1fdbdbc1ba928a27db1d321a23fcd (patch)
tree9db0788a1af744a7212256eb41d68d7d9f4ac5c3 /Lib
parentbe446b4ab7f3040d9e0854119d2d44cd39a48d9e (diff)
downloadcpython-ac830e932df1fdbdbc1ba928a27db1d321a23fcd.zip
cpython-ac830e932df1fdbdbc1ba928a27db1d321a23fcd.tar.gz
cpython-ac830e932df1fdbdbc1ba928a27db1d321a23fcd.tar.bz2
A bugfix for r61813, it would fail if the data size was >=2**32.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/gzip.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/gzip.py b/Lib/gzip.py
index f3cf9fe..2246c9d 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -15,10 +15,6 @@ FTEXT, FHCRC, FEXTRA, FNAME, FCOMMENT = 1, 2, 4, 8, 16
READ, WRITE = 1, 2
-def U32(i):
- """Return the low-order 32 bits, as a non-negative int or long."""
- return i & 0xFFFFFFFFL
-
def write32u(output, value):
# The L format writes the bit pattern correctly whether signed
# or unsigned.
@@ -306,7 +302,7 @@ class GzipFile:
if crc32 != self.crc:
raise IOError("CRC check failed %s != %s" % (hex(crc32),
hex(self.crc)))
- elif isize != self.size:
+ elif isize != (self.size & 0xffffffffL):
raise IOError, "Incorrect length of data produced"
def close(self):