From e1c620d41d58be580118e346e04ab7787393caa9 Mon Sep 17 00:00:00 2001 From: Francisco Facioni Date: Mon, 5 Mar 2018 15:41:51 +0000 Subject: [PATCH 1/2] bpo-22102: Fixes zip files with disks set to 0 --- Lib/zipfile.py | 2 +- .../next/Library/2018-03-08-16-15-00.bpo-22102.th33uD.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2018-03-08-16-15-00.bpo-22102.th33uD.rst diff --git a/Lib/zipfile.py b/Lib/zipfile.py index b90b60f72e2bcd..fee6704b286397 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -201,7 +201,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 index 00000000000000..5c5f45558a75c8 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-03-08-16-15-00.bpo-22102.th33uD.rst @@ -0,0 +1 @@ +Fixes zip files with disks set to 0 From 7c44a591a46856ea22d74dbd70387bc9a7f0ae3d Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sat, 25 May 2019 13:00:27 +0300 Subject: [PATCH 2/2] Update 2018-03-08-16-15-00.bpo-22102.th33uD.rst --- .../next/Library/2018-03-08-16-15-00.bpo-22102.th33uD.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 index 5c5f45558a75c8..ad690f57c52384 100644 --- 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 @@ -1 +1,2 @@ -Fixes zip files with disks set to 0 +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.