cpython: c62fa6892424 (original) (raw)
Mercurial > cpython
changeset 77015:c62fa6892424
Issue #13031: Small speed-up for tarfile when unzipping tarfiles. Patch by Justin Peel. [#13031]
Ross Lagerwall rosslagerwall@gmail.com | |
---|---|
date | Thu, 17 May 2012 19:49:27 +0200 |
parents | 31ac156000c8 |
children | 8e3425396912 |
files | Lib/tarfile.py Misc/ACKS Misc/NEWS |
diffstat | 3 files changed, 6 insertions(+), 2 deletions(-)[+] [-] Lib/tarfile.py 4 Misc/ACKS 1 Misc/NEWS 3 |
line wrap: on
line diff
--- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -245,8 +245,8 @@ def calc_chksums(buf): the high bit set. So we calculate two checksums, unsigned and signed. """
- unsigned_chksum = 256 + sum(struct.unpack("148B", buf[:148]) + struct.unpack("356B", buf[156:512]))
- signed_chksum = 256 + sum(struct.unpack("148b", buf[:148]) + struct.unpack("356b", buf[156:512]))
- unsigned_chksum = 256 + sum(struct.unpack_from("148B8x356B", buf))
- signed_chksum = 256 + sum(struct.unpack_from("148b8x356b", buf)) return unsigned_chksum, signed_chksum def copyfileobj(src, dst, length=None):
--- a/Misc/ACKS +++ b/Misc/ACKS @@ -776,6 +776,7 @@ Gaƫl Pasgrimaud Joe Peterson Randy Pausch Samuele Pedroni +Justin Peel Marcel van der Peijl Berker Peksag Steven Pemberton
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -38,6 +38,9 @@ Core and Builtins Library ------- +- Issue #13031: Small speed-up for tarfile when unzipping tarfiles.