[issue10828] Cannot use nonascii utf8 in names of files imported from

STINNER Victor report at bugs.python.org
Sat Jan 8 17:13:24 CET 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

> Victor: How do I determine what code page my old w2k is using?.

python.exe -c 'import locale; print("ANSI code page: {}".format(locale.getpreferredencoding()))'


> On Windows, #8611 (and #9425) permit to use non-ASCII characters 
> in the module path... but only characters encodable to your 
> ANSI code page.

If you would like to check if your path is encodable to your ANSI code page, try:

python.exe -c "import os; fn=os.fsencode('ä'); print(ascii(fn))"

If fsencode() raises an error, the filename is not encodable to your ANSI code page and you have to wait until #3080 is fixed :-)

----------

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


More information about the Python-bugs-list mailing list