From 35677b904c0c20302477b077a90882c3aac34d2b Mon Sep 17 00:00:00 2001 From: Silas Sewell Date: Tue, 18 Sep 2018 13:00:05 -0400 Subject: [PATCH] [2.7] bpo-34472: Add data descriptor signature to zipfile (GH-8871) 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 0f890ac6f3ab15..991a0add205d17 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -131,6 +131,8 @@ class LargeZipFile(Exception): _CD64_DIRECTORY_SIZE = 8 _CD64_OFFSET_START_CENTDIR = 9 +_DD_SIGNATURE = 0x08074b50 + _EXTRA_FIELD_STRUCT = struct.Struct('