From: Tim Peters Date: Tue, 5 Nov 2002 20:38:55 +0000 (+0000) Subject: Another round on SF patch 618135: gzip.py and files > 2G X-Git-Tag: v2.3c1~3568 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9288f95cb5d7be807c2ba6dbc195ec6b52ac3bd4;p=python Another round on SF patch 618135: gzip.py and files > 2G The last round boosted "the limit" from 2GB to 4GB. This round gets rid of the 4GB limit. For files > 4GB, gzip stores just the last 32 bits of the file size, and now we play along with that too. Tested by hand (on a 6+GB file) on Win2K. Boosting from 2GB to 4GB was arguably enough "a bugfix". Going beyond that smells more like "new feature" to me. --- diff --git a/Lib/gzip.py b/Lib/gzip.py index 8802adb0d9..36f9c36fd3 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -24,6 +24,10 @@ def U32(i): i += 1L << 32 return i +def LOWU32(i): + """Return the low-order 32 bits of an int, as a non-negative int.""" + return i & 0xFFFFFFFFL + def write32(output, value): output.write(struct.pack("