]> granicus.if.org Git - python/commitdiff
Issue #3535: zipfile couldn't read some zip files larger than 2GB.
authorAntoine Pitrou <solipsis@pitrou.net>
Fri, 5 Sep 2008 23:30:23 +0000 (23:30 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Fri, 5 Sep 2008 23:30:23 +0000 (23:30 +0000)
Reviewed by Amaury Forgeot d'Arc.

Lib/zipfile.py
Misc/NEWS

index ac17177e9c3f9bf37852b3bb0169afaf9277a041..bb8fc53de4dc4c0845d3498c527458da1dcbd795 100644 (file)
@@ -163,6 +163,7 @@ def _EndRecData64(fpin, offset, endrec):
         return endrec
 
     # Update the original endrec using data from the ZIP64 record
+    endrec[_ECD_SIGNATURE] = sig
     endrec[_ECD_DISK_NUMBER] = disk_num
     endrec[_ECD_DISK_START] = disk_dir
     endrec[_ECD_ENTRIES_THIS_DISK] = dircount
@@ -735,9 +736,8 @@ class ZipFile:
 
         # "concat" is zero, unless zip was concatenated to another file
         concat = endrec[_ECD_LOCATION] - size_cd - offset_cd
-        if endrec[_ECD_LOCATION] > ZIP64_LIMIT:
-            # If the offset of the "End of Central Dir" record requires Zip64
-            # extension structures, account for them
+        if endrec[_ECD_SIGNATURE] == stringEndArchive64:
+            # If Zip64 extension structures are present, account for them
             concat -= (sizeEndCentDir64 + sizeEndCentDir64Locator)
 
         if self.debug > 2:
index 1ab858191889f15c65e3b87f0ab4c7f765a92ae8..d06bfebd1dbaac6f181281a9ed750e63e99c3313 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -56,7 +56,9 @@ C-API
 Library
 -------
 
-- Issue 3776: Deprecate the bsddb package for removal in 3.0.
+- Issue #3535: zipfile couldn't read some zip files larger than 2GB.
+
+- Issue #3776: Deprecate the bsddb package for removal in 3.0.
 
 - Issue #3762: platform.architecture() fails if python is lanched via
   its symbolic link.