Thomas Kluyver added the comment: zipinfo-from-file.patch has an orthogonal but related change: the code in ZipFile.write() to construct a ZipInfo object from a filesystem file is pulled out to a classmethod ZipInfo.from_file().
Together, these changes make it much easier to control how a file is written to a zip file, like this: zi = ZipInfo.from_file(blah) # ... manipulate zi... with open(blah, 'rb') as src, zf.open(zi, 'w') as dest: # copy of the read/write loop - maybe this should be # pulled out separately as well? If these changes make it in, I might put a backported copy of the module on PyPI so I can start using it without waiting for Python 3.6. ---------- Added file: http://bugs.python.org/file41637/zipinfo-from-file.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26039> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com