]> granicus.if.org Git - python/commitdiff
[Bug #822668] tarfile raises an exception if the tarfile is gzipped and is too large...
authorAndrew M. Kuchling <amk@amk.ca>
Fri, 24 Oct 2003 17:38:34 +0000 (17:38 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Fri, 24 Oct 2003 17:38:34 +0000 (17:38 +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()