New submission from Xuanji Li <xua...@gmail.com>:

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

----------
assignee: docs@python
components: Documentation, Library (Lib)
messages: 128217
nosy: docs@python, haypo, xuanji
priority: normal
severity: normal
status: open
title: ZipFile.comment expects bytes
versions: Python 3.2

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

Reply via email to