[issue17656] Python 2.7.4 breaks ZipFile extraction of zip files with unicode member paths

Christian Heimes report at bugs.python.org
Sat Apr 20 22:05:23 CEST 2013


Christian Heimes added the comment:

it seems like file() can't handle unicode file names on FreeBSD. The FS encoding is 'US-ASCII' on Snakebite's FreeBSD box.

> /home/cpython/users/christian.heimes/2.7/Lib/zipfile.py(1078)_extract_member()
-> with self.open(member, pwd=pwd) as source, \
(Pdb) self.open(member, pwd=pwd)
<zipfile.ZipExtFile object at 0x801eb5fd0>
(Pdb) n
> /home/cpython/users/christian.heimes/2.7/Lib/zipfile.py(1079)_extract_member()
-> file(targetpath, "wb") as target:
(Pdb) file(targetpath, "wb")
*** UnicodeEncodeError: 'ascii' codec can't encode characters in position 47-48: ordinal not in range(128)
(Pdb) sys.getfilesystemencoding()
'US-ASCII'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17656>
_______________________________________


More information about the Python-bugs-list mailing list