Message128217
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 zipfile.py to accept string and try to convert, throwing an error if the conversion fails |
|
Date |
User |
Action |
Args |
2011-02-09 15:09:01 | xuanji | set | recipients:
+ xuanji, vstinner, docs@python |
2011-02-09 15:09:00 | xuanji | set | messageid: <1297264140.97.0.306129367766.issue11160@psf.upfronthosting.co.za> |
2011-02-09 15:09:00 | xuanji | link | issue11160 messages |
2011-02-09 15:09:00 | xuanji | create | |
|