[Python-checkins] r61822 - python/trunk/Lib/gzip.py

gregory.p.smith python-checkins at python.org
Mon Mar 24 00:45:12 CET 2008


Author: gregory.p.smith
Date: Mon Mar 24 00:45:12 2008
New Revision: 61822

Modified:
   python/trunk/Lib/gzip.py
Log:
prevent a warning from the struct module when data size >= 2**32.


Modified: python/trunk/Lib/gzip.py
==============================================================================
--- python/trunk/Lib/gzip.py	(original)
+++ python/trunk/Lib/gzip.py	Mon Mar 24 00:45:12 2008
@@ -310,7 +310,7 @@
             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


More information about the Python-checkins mailing list