Message234786
On Windows, using zipimport module APIs like get_filename on a file with non-ascii characters in the full path fails with
UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: invalid character ( Full output attached in errorlog.txt ).
The issue is that Modules/zipimport.c has a function compile_source which tries to run PyUnicode_EncodeFSDefault on the pathname. On Windows, the default encoding is 'mbcs' which cannot handle unicode characters.
This has already been fixed in the import machinery on python 3 ( see issue http://bugs.python.org/issue13758, http://bugs.python.org/issue11619). The solution is to pass the pathname as Unicode directly to the compiler. |
|
Date |
User |
Action |
Args |
2015-01-26 22:43:57 | amswap | set | recipients:
+ amswap, vstinner, tim.golden, ezio.melotti, zach.ware, steve.dower |
2015-01-26 22:43:56 | amswap | set | messageid: <1422312236.18.0.216782202017.issue23327@psf.upfronthosting.co.za> |
2015-01-26 22:43:56 | amswap | link | issue23327 messages |
2015-01-26 22:43:55 | amswap | create | |
|