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 xuanji
Recipients docs@python, vstinner, xuanji
Date 2011-02-09.15:09:00
SpamBayes Score 7.72342e-08
Marked as misclassified No
Message-id <>
The documentation for zipfile describes ZipFile.comment as "The comment text associated with the ZIP file." From reading this I expect that setting it to a string is ok; however ZipFile.comment must actually be set to bytes (or a bytes-like object, I am not very sure).

This may also unexpectedly affect old code because I saw one patch on the bug tracker that was written just last year that set ZipFile.comment to a string. 

IMO there are 2 ways to fix:

1) Change docs to mention that ZipFile.comment only accepts bytes
2) Patch to accept string and try to convert, throwing an error if the conversion fails
Date User Action Args
2011-02-09 15:09:01xuanjisetrecipients: + xuanji, vstinner, docs@python
2011-02-09 15:09:00xuanjisetmessageid: <>
2011-02-09 15:09:00xuanjilinkissue11160 messages
2011-02-09 15:09:00xuanjicreate