classification
Title: Add support of writing to unseekable file in zipfile
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: Matt.Mackall, Patrik Dufresne, python-dev, r.david.murray, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2015-01-16 19:55 by serhiy.storchaka, last changed 2016-02-02 17:23 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
zipfile_write_unseekable.patch serhiy.storchaka, 2015-02-01 17:16 review
Messages (6)
msg234145 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-01-16 19:55
ZIP files can be created to transfer it via unseekable streams (pipes, sockets). Mercurial uses a workaround to write ZIP files right to wsgirequest, but this is possible only with writestr(). write() needs seek() to updated file size, compressed sized and CRC. However ZIP file format supports streamed data without writing sizes and CRC before file data. It is possible and desirable to add full support of unseekable output files in zipfile.
msg235184 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-02-01 17:16
Here is a patch. Mercurial wouldn't need a wrapper in Python 3.5.
msg236360 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-02-21 10:22
Could you please make a review of the documentation part of the patch David?
msg238951 - (view) Author: Roundup Robot (python-dev) Date: 2015-03-22 23:10
New changeset 19f36a2a34ec by Serhiy Storchaka in branch 'default':
Issue #23252:  Added support for writing ZIP files to unseekable streams.
https://hg.python.org/cpython/rev/19f36a2a34ec
msg259274 - (view) Author: Patrik Dufresne (Patrik Dufresne) Date: 2016-01-31 02:10
While this path provide support to create Zip file for non-seekable stream. It doesn't support reading a file from a non-seekable stream.
msg259406 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-02-02 17:23
Currently the zipfile module requires seekable stream to read a list of entries from central directory at the end of ZIP file, and for reding their content in arbitrary order. The support of unseekable stream needs to design a new API. This is separate issue.
History
Date User Action Args
2016-02-02 17:23:08serhiy.storchakasetmessages: + msg259406
2016-01-31 02:10:46Patrik Dufresnesetnosy: + Patrik Dufresne
messages: + msg259274
2015-03-23 08:35:07serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2015-03-22 23:10:36python-devsetnosy: + python-dev
messages: + msg238951
2015-02-21 10:22:18serhiy.storchakasetnosy: + r.david.murray
messages: + msg236360
2015-02-01 17:16:27serhiy.storchakasetfiles: + zipfile_write_unseekable.patch

nosy: + Matt.Mackall
messages: + msg235184

keywords: + patch
stage: needs patch -> patch review
2015-01-16 19:55:48serhiy.storchakacreate