From 6ec298114855b648a1f5fc4188ea3686a9d77fb3 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sat, 22 Sep 2018 20:48:23 +0300 Subject: [PATCH] =?utf8?q?[2.7]=20bpo-34472:=20Add=20data=20descriptor=20s?= =?utf8?q?ignature=20to=20zipfile=20(GH-8871)=20(=D0=9F=D0=A0-9407)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This makes streamed zips compatible with MacOS Archive Utility and other applications. (cherry picked from commit 4ba3b50bfe6d50cd82d208023ea23e203ab50589) Co-authored-by: Silas Sewell --- Lib/zipfile.py | 8 +++++--- Misc/ACKS | 1 + .../next/Library/2018-08-23-09-25-08.bpo-34472.cGyYrO.rst | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2018-08-23-09-25-08.bpo-34472.cGyYrO.rst diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 0f890ac6f3ab..991a0add205d 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -131,6 +131,8 @@ _CD64_NUMBER_ENTRIES_TOTAL = 7 _CD64_DIRECTORY_SIZE = 8 _CD64_OFFSET_START_CENTDIR = 9 +_DD_SIGNATURE = 0x08074b50 + _EXTRA_FIELD_STRUCT = struct.Struct('