changeset: 77015:c62fa6892424 user: Ross Lagerwall date: Thu May 17 19:49:27 2012 +0200 files: Lib/tarfile.py Misc/ACKS Misc/NEWS description: Issue #13031: Small speed-up for tarfile when unzipping tarfiles. Patch by Justin Peel. diff -r 31ac156000c8 -r c62fa6892424 Lib/tarfile.py --- a/Lib/tarfile.py Thu May 17 19:00:35 2012 +0200 +++ b/Lib/tarfile.py Thu May 17 19:49:27 2012 +0200 @@ -245,8 +245,8 @@ 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): diff -r 31ac156000c8 -r c62fa6892424 Misc/ACKS --- a/Misc/ACKS Thu May 17 19:00:35 2012 +0200 +++ b/Misc/ACKS Thu May 17 19:49:27 2012 +0200 @@ -776,6 +776,7 @@ Joe Peterson Randy Pausch Samuele Pedroni +Justin Peel Marcel van der Peijl Berker Peksag Steven Pemberton diff -r 31ac156000c8 -r c62fa6892424 Misc/NEWS --- a/Misc/NEWS Thu May 17 19:00:35 2012 +0200 +++ b/Misc/NEWS Thu May 17 19:49:27 2012 +0200 @@ -38,6 +38,9 @@ Library ------- +- Issue #13031: Small speed-up for tarfile when unzipping tarfiles. + Patch by Justin Peel. + - Issue #14780: urllib.request.urlopen() now has a ``cadefault`` argument to use the default certificate store. Initial patch by James Oakley.

AltStyle によって変換されたページ (->オリジナル) /