This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients methane, ned.deily, serhiy.storchaka, sjt
Date 2016-12-26.13:29:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1482758989.48.0.920431096721.issue28080@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-12-26 13:29:49serhiy.storchakasetrecipients: + serhiy.storchaka, ned.deily, sjt, methane
2016-12-26 13:29:49serhiy.storchakasetmessageid: <1482758989.48.0.920431096721.issue28080@psf.upfronthosting.co.za>
2016-12-26 13:29:49serhiy.storchakalinkissue28080 messages
2016-12-26 13:29:49serhiy.storchakacreate