Serhiy Storchaka added the comment:

A ZipFile can be read when open in not read-only mode. Thus the encoding 
argument should be accepted when mode != 'r'.

It would be weird to read file names and write new entries with different 
encodings. Thus the encoding argument should affect output encoding too.

You have named the new ZipFile attribute metadataEncoding. Indeed, I missed 
this, and other developers missed this when ported to Python 3, but the 
specification says, that the UTF-8 bit affect not just the encoding of file 
names, but the encoding of comments. Thus a file comment must be a string, and 
be decoded with the same encoding as a file name. Currently it is of type 
bytes. I don't know what is the best way to resolve this issue without breaking 
backward compatibility. Perhaps add the text_comment property.

----------

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

Reply via email to