Eryk Sun added the comment:

The problem is that the compile_source function in Modules/zipimport.c calls 
PyUnicode_EncodeFSDefault to get an encoded string to pass as the filename 
argument of Py_CompileString. On Windows this uses the ANSI codepage (i.e. 
'mbcs'). Apparently your system's ANSI codepage doesn't map the "Ł" character. 

I reproduced the problem more simply by copying pip-7.1.2-py2.py3-none-any.whl 
to a subdirectory named "Łukasz"; adding the wheel path to sys.path; and 
attempting to execute "import pip". 

One solution is to replace Py_CompileString with Py_CompileStringObject. This 
way compile_source doesn't have to worry about encoding its pathname argument. 
A minimal patch is attached, but it needs a test.

----------
keywords: +patch
nosy: +eryksun
versions: +Python 3.6
Added file: http://bugs.python.org/file41185/issue25758_1.patch

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

Reply via email to