classification
Title: Add zip64 support to shutil
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: out of date
Dependencies: Superseder: Use allowZip64=True by default
View: 17201
Assigned To: Nosy List: hynek, pitrou, serhiy.storchaka, tarek, william.mallard
Priority: normal Keywords: patch

Created on 2013-02-12 05:29 by william.mallard, last changed 2015-02-05 21:20 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
shutil_zip64.patch william.mallard, 2013-02-12 05:29 review
shutil_zip64_by_default.patch william.mallard, 2013-02-13 15:50 review
shutil_zip64_by_default.patch william.mallard, 2013-02-13 19:25 Added documentation. review
Messages (8)
msg181941 - (view) Author: William Mallard (william.mallard) * Date: 2013-02-12 05:29
This patch enables creation of 64-bit zip files via make_archive().

make_archive uses ZipFile to create zip files. ZipFile already supports creation of 64-bit archives via a kwarg, but make_archive hard-codes it to 32-bit. This patch exposes the option in a backwards compatible way.
msg182009 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-02-13 10:10
Would there be a way to automatically switch the flag as necessary?
(i.e. when writing more than 2GB, I guess)
msg182018 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-02-13 10:55
> Would there be a way to automatically switch the flag as necessary?
> (i.e. when writing more than 2GB, I guess)

Yes, there is a special flag for this in zipfile. It is named allowZip64.

The only reason to use allowZip64=False is when you expect to unzip a zipfile with a tool which doesn't support zip64 (PKUNZIP.EXE for DOS?) and you want to keep yourself from unintentional zipping a file larger than 2 GiB.

Perhaps sometime we should to change the default value for allowZip64 from False to True.
msg182027 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-02-13 12:10
> Yes, there is a special flag for this in zipfile. It is named
> allowZip64.

Then I think shutil should set allowZip64 to True by default.
People who want fine-grained control over the zipfile's characteristics can still use the zipfile module directly.
msg182032 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-02-13 13:14
Agree.
msg182043 - (view) Author: William Mallard (william.mallard) * Date: 2013-02-13 15:50
Ok, here's a patch that makes zip64 the default in make_archive() when format='zip'.

I also agree that ZipFile should set allowZip64=True by default. (PKZIP has supported zip64 since 2001!)
msg182052 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-02-13 17:17
This should be reflected in the documentation.
msg182059 - (view) Author: William Mallard (william.mallard) * Date: 2013-02-13 19:25
Documentation added. See attached.
History
Date User Action Args
2015-02-05 21:20:26serhiy.storchakasetstatus: open -> closed
stage: patch review -> resolved
2015-02-05 21:20:11serhiy.storchakasetsuperseder: Use allowZip64=True by default
dependencies: - Use allowZip64=True by default
resolution: out of date
2013-02-13 19:25:26william.mallardsetfiles: + shutil_zip64_by_default.patch

messages: + msg182059
2013-02-13 17:17:07serhiy.storchakasetdependencies: + Use allowZip64=True by default
messages: + msg182052
2013-02-13 15:50:41william.mallardsetfiles: + shutil_zip64_by_default.patch

messages: + msg182043
2013-02-13 13:14:26serhiy.storchakasetmessages: + msg182032
2013-02-13 12:10:17pitrousetmessages: + msg182027
2013-02-13 10:55:30serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg182018
2013-02-13 10:10:24pitrousetnosy: + hynek, tarek, pitrou
messages: + msg182009
2013-02-12 13:16:11r.david.murraysetstage: patch review
versions: + Python 3.4, - Python 3.3
2013-02-12 05:29:24william.mallardcreate