classification
Title: zipfile: does not include optional descriptor signature
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: serhiy.storchaka, silas
Priority: normal Keywords: patch

Created on 2018-08-23 12:57 by silas, last changed 2018-09-22 18:03 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
zip_stream_example.py silas, 2018-08-23 12:57 Example code showing issue
Pull Requests
URL Status Linked Edit
PR 8871 merged silas, 2018-08-23 13:01
PR 9398 merged miss-islington, 2018-09-18 17:04
PR 9399 merged miss-islington, 2018-09-18 17:04
PR 9407 merged serhiy.storchaka, 2018-09-18 20:33
Messages (6)
msg323943 - (view) Author: Silas Sewell (silas) * Date: 2018-08-23 12:57
When adding a fileobj that is not seekable to a zip using the zipfile module, the optional signature value 0x08074b50 is not included. This breaks certain zip implementations, including the builtin MacOS Archive Utility.

See https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT sections 4.3.9.3 and 4.3.9.4
msg325664 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-09-18 17:00
New changeset 4ba3b50bfe6d50cd82d208023ea23e203ab50589 by Serhiy Storchaka (Silas Sewell) in branch 'master':
bpo-34472: Add data descriptor signature to zipfile (GH-8871)
https://github.com/python/cpython/commit/4ba3b50bfe6d50cd82d208023ea23e203ab50589
msg325667 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-09-18 17:34
Thank you for your contribution Silas.

Since popular ZIP file implementation like Info-ZIP and Java write this signature unconditionally, I think most unzipping software support it if they support reading ZIP files in streaming mode at all, at it is safe to backport this change to all maintained versions.
msg326101 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-09-22 17:48
New changeset 6ec298114855b648a1f5fc4188ea3686a9d77fb3 by Serhiy Storchaka in branch '2.7':
[2.7] bpo-34472: Add data descriptor signature to zipfile (GH-8871) (ПР-9407)
https://github.com/python/cpython/commit/6ec298114855b648a1f5fc4188ea3686a9d77fb3
msg326104 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-09-22 18:02
New changeset ed21919d69ac22232cbc0dad0323477818112b6f by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6':
bpo-34472: Add data descriptor signature to zipfile (GH-8871) (GH-9398)
https://github.com/python/cpython/commit/ed21919d69ac22232cbc0dad0323477818112b6f
msg326105 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-09-22 18:03
New changeset 44989bc2696320cf55ae6f329aaf58edd49d792a by Serhiy Storchaka (Miss Islington (bot)) in branch '3.7':
bpo-34472: Add data descriptor signature to zipfile (GH-8871) (GH-9399)
https://github.com/python/cpython/commit/44989bc2696320cf55ae6f329aaf58edd49d792a
History
Date User Action Args
2018-09-22 18:03:48serhiy.storchakasetresolution: rejected -> fixed
2018-09-22 18:03:34serhiy.storchakasetstatus: open -> closed
resolution: rejected
stage: patch review -> resolved
2018-09-22 18:03:08serhiy.storchakasetmessages: + msg326105
2018-09-22 18:02:56serhiy.storchakasetmessages: + msg326104
2018-09-22 17:48:26serhiy.storchakasetmessages: + msg326101
2018-09-18 20:33:39serhiy.storchakasetpull_requests: + pull_request8830
2018-09-18 17:34:32serhiy.storchakasettype: behavior
messages: + msg325667
versions: + Python 2.7, - Python 3.5
2018-09-18 17:04:34miss-islingtonsetpull_requests: + pull_request8822
2018-09-18 17:04:17miss-islingtonsetpull_requests: + pull_request8821
2018-09-18 17:00:09serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg325664
2018-08-23 13:01:45silassetkeywords: + patch
stage: patch review
pull_requests: + pull_request8348
2018-08-23 12:57:59silascreate