]> granicus.if.org Git - python/commitdiff
prevent a warning from the struct module when data size >= 2**32.
authorGregory P. Smith <greg@mad-scientist.com>
Sun, 23 Mar 2008 23:45:12 +0000 (23:45 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Sun, 23 Mar 2008 23:45:12 +0000 (23:45 +0000)
Lib/gzip.py

index 2246c9d6ef9ba0fb40bd7b7b601f24361813737a..eeef3f8b908ef228eaa2328d68805371180c0cc8 100644 (file)
@@ -310,7 +310,7 @@ class GzipFile:
             self.fileobj.write(self.compress.flush())
             write32u(self.fileobj, self.crc)
             # self.size may exceed 2GB, or even 4GB
-            write32u(self.fileobj, self.size)
+            write32u(self.fileobj, self.size & 0xffffffffL)
             self.fileobj = None
         elif self.mode == READ:
             self.fileobj = None