Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 10a4449

Browse files
committed
[Bug #822668] tarfile raises an exception if the tarfile is gzipped and is too large; the gzip filesize should be written out mod 2**32. (Reported by Johan Fredrik Ohman)
1 parent 1b3c04b commit 10a4449

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/tarfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def close(self):
357357
self.buf = ""
358358
if self.type == "gz":
359359
self.fileobj.write(struct.pack("<l", self.crc))
360-
self.fileobj.write(struct.pack("<L", self.pos))
360+
self.fileobj.write(struct.pack("<L", self.pos & 0xffffFFFFL))
361361

362362
if not self._extfileobj:
363363
self.fileobj.close()

0 commit comments

Comments
 (0)