[Python-checkins] cpython (merge default -> default): Merge

antoine.pitrou python-checkins at python.org
Thu May 17 21:07:19 CEST 2012


http://hg.python.org/cpython/rev/8e3425396912
changeset:   77017:8e3425396912
parent:      77016:423a26e8ffbb
parent:      77015:c62fa6892424
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Thu May 17 21:04:49 2012 +0200
summary:
  Merge

files:
  Lib/tarfile.py |  4 ++--
  Misc/ACKS      |  1 +
  Misc/NEWS      |  3 +++
  3 files changed, 6 insertions(+), 2 deletions(-)


diff --git a/Lib/tarfile.py b/Lib/tarfile.py
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -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 --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -776,6 +776,7 @@
 Joe Peterson
 Randy Pausch
 Samuele Pedroni
+Justin Peel
 Marcel van der Peijl
 Berker Peksag
 Steven Pemberton
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list