summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2008-09-05 23:30:23 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2008-09-05 23:30:23 (GMT)
commitebcd0ced14388d5859e4c57e9916a3f18e35e9c2 (patch)
treee246db07d27b9daa723ae5906e46caf7c0df8c6e /Lib
parentcdeb24bb05359ec7550c327f44e8b1f346b9d776 (diff)
downloadcpython-ebcd0ced14388d5859e4c57e9916a3f18e35e9c2.zip
cpython-ebcd0ced14388d5859e4c57e9916a3f18e35e9c2.tar.gz
cpython-ebcd0ced14388d5859e4c57e9916a3f18e35e9c2.tar.bz2
Issue #3535: zipfile couldn't read some zip files larger than 2GB.
Reviewed by Amaury Forgeot d'Arc.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/zipfile.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index ac17177..bb8fc53 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -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: