This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gumblex
Recipients gumblex
Date 2015-11-14.09:25:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1447493124.52.0.848319062026.issue25624@psf.upfronthosting.co.za>
In-reply-to
Content
The _make_zipfile in shutil uses ZIP_DEFLATED compression by default, and the fix introduced by #24982 adds directory entries. In zipfile.ZipFile.write, directories is added as 0 file_size, 0 compress_size, regardless of the compression method. Deflate will compress an empty string as \x03\x00, thus the directory entries become incorrect.

The command line interface of zipfile is correct. Shutil can be fixed as zipfile.main. As a directory entry with compression methods other than ZIP_STORED is meaningless, zipfile.write and (maybe) zipfile.writestr should always write a ZIP_STORED header for directory entries to avoid the above problem occuring by programming mistakes.
History
Date User Action Args
2015-11-14 09:25:24gumblexsetrecipients: + gumblex
2015-11-14 09:25:24gumblexsetmessageid: <1447493124.52.0.848319062026.issue25624@psf.upfronthosting.co.za>
2015-11-14 09:25:24gumblexlinkissue25624 messages
2015-11-14 09:25:24gumblexcreate