]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-22102: Fixes zip files with disks set to 0 (GH-5985)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 28 May 2019 23:33:21 +0000 (16:33 -0700)
committerGitHub <noreply@github.com>
Tue, 28 May 2019 23:33:21 +0000 (16:33 -0700)
(cherry picked from commit ab0716ed1ea2957396054730afbb80c1825f9786)

Co-authored-by: Francisco Facioni <fran6co@gmail.com>
Lib/zipfile.py
Misc/NEWS.d/next/Library/2018-03-08-16-15-00.bpo-22102.th33uD.rst [new file with mode: 0644]

index e83600e13d5efdff4a64c8be2febccabc38964a6..955d91fd0a2bf3cc9022ae41cef34196b219aa19 100644 (file)
@@ -224,7 +224,7 @@ def _EndRecData64(fpin, offset, endrec):
     if sig != stringEndArchive64Locator:
         return endrec
 
-    if diskno != 0 or disks != 1:
+    if diskno != 0 or disks > 1:
         raise BadZipFile("zipfiles that span multiple disks are not supported")
 
     # Assume no 'zip64 extensible data'
diff --git a/Misc/NEWS.d/next/Library/2018-03-08-16-15-00.bpo-22102.th33uD.rst b/Misc/NEWS.d/next/Library/2018-03-08-16-15-00.bpo-22102.th33uD.rst
new file mode 100644 (file)
index 0000000..ad690f5
--- /dev/null
@@ -0,0 +1,2 @@
+Added support for ZIP files with disks set to 0. Such files are commonly created by builtin tools on Windows when use ZIP64 extension.
+Patch by Francisco Facioni.