classification
Title: Awkward to set compression on writeable ZipFile.open()
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.7
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: alanmcintyre, dholth, serhiy.storchaka, twouters
Priority: normal Keywords:

Created on 2020-04-08 23:14 by dholth, last changed 2020-04-09 04:12 by dholth. This issue is now closed.

Messages (2)
msg366028 - (view) Author: Daniel Holth (dholth) * Date: 2020-04-08 23:14
It looks like this is the current API to set compression at the individual file level when writing with ZipFile.open()

        z.compression = zipfile.ZIP_STORED
        data_writer = z.open(zip_info or filename, "w")
        z.compression = saved

It would be useful to have a parameter or to honor the compression setting of the passed ZipInfo.
msg366034 - (view) Author: Daniel Holth (dholth) * Date: 2020-04-09 04:12
My mistake. It honors ZipInfo if passed.
History
Date User Action Args
2020-04-09 04:12:42dholthsetstatus: open -> closed

messages: + msg366034
stage: resolved
2020-04-08 23:14:05dholthcreate