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 amswap
Recipients amswap, ezio.melotti, steve.dower, tim.golden, vstinner, zach.ware
Date 2015-01-26.22:43:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1422312236.18.0.216782202017.issue23327@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-01-26 22:43:57amswapsetrecipients: + amswap, vstinner, tim.golden, ezio.melotti, zach.ware, steve.dower
2015-01-26 22:43:56amswapsetmessageid: <1422312236.18.0.216782202017.issue23327@psf.upfronthosting.co.za>
2015-01-26 22:43:56amswaplinkissue23327 messages
2015-01-26 22:43:55amswapcreate