Swapneel Ambre added the comment:
Attaching a combined patch. I updated testUnencodable testcase from
test_zipimport.py. Verified that without my fix, the testcase fails and it
passes with my fix.
--
Added file: http://bugs.python.org/file37883/zipimport_fix_withtest.patch
Swapneel Ambre added the comment:
Sorry I was not very clear about the use case.
The name of the zipfile or any parent directory name could contain non-ascii
characters. Consider a use case where you want to ship some product with third
party module shipped as an egg file (say example.egg
Swapneel Ambre added the comment:
I have tried to fix this by calling Py_CompileStringObject instead of
Py_CompileString , thus avoiding the need to Encode the pathname. Please see
zipimport_fix.patch for the possible fix.
--
keywords: +patch
Added file: http://bugs.python.org
Swapneel Ambre added the comment:
I am attaching the test script I have used to reproduce the issue.
--
Added file: http://bugs.python.org/file37873/zipimport_test.py
___
Python tracker
<http://bugs.python.org/issue23
New submission from Swapneel Ambre:
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