]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[Backport fix for bug #822668] gzip filesize should be written out mod 2**32
authorAndrew M. Kuchling <amk@amk.ca>
Fri, 24 Oct 2003 17:47:57 +0000 (17:47 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Fri, 24 Oct 2003 17:47:57 +0000 (17:47 +0000)
Lib/tarfile.py

index 9dd8601cb63e445b58cae9001af8a44b2fa40367..26f9c7f6acff459cdbc16604bb8a10627f5db136 100644 (file)
@@ -357,7 +357,7 @@ class _Stream:
             self.buf = ""
             if self.type == "gz":
                 self.fileobj.write(struct.pack("<l", self.crc))
-                self.fileobj.write(struct.pack("<L", self.pos))
+                self.fileobj.write(struct.pack("<L", self.pos & 0xffffFFFFL))
 
         if not self._extfileobj:
             self.fileobj.close()