Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee='https://github.com/serhiy-storchaka'closed_at=<Date2015-03-23.08:35:07.357>created_at=<Date2015-01-16.19:55:48.019>labels= ['type-feature', 'library']
title='Add support of writing to unseekable file in zipfile'updated_at=<Date2016-02-02.17:23:08.630>user='https://github.com/serhiy-storchaka'
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.
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.