New submission from keeely <s...@sophos.com>:

Python 2.7 allows one to capture from one file a list of ZipInfo objects, and 
then recreate a new file using those ZipInfo objects.  The same thing appears 
to be impossible with Python 3 without resorting to monkey-patches because of a 
line of code in the writestr() code path ignoring the passed in value of 
ZipInfo and overwritting it with zeros.

See:
https://github.com/python/cpython/blob/master/Lib/zipfile.py#L1567

See also a possible solution at:
https://stackoverflow.com/questions/53254622/zipfile-header-language-encoding-bit-set-differently-between-python2-and-python3

----------
components: Library (Lib)
messages: 329733
nosy: keeely
priority: normal
severity: normal
status: open
title: Impossible to round-trip decompress -> compress zipfiles with Python 3 
due to losing flag_bits
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35218>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to