[issue13247] os.path.abspath returns unicode paths as question marks

STINNER Victor report at bugs.python.org
Wed Oct 26 02:12:44 CEST 2011


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

Le 26/10/2011 01:32, Atsuo Ishimoto a écrit :
> - I don't think filenames cannot be decoded in ANSI code page are rare enough to be ignored.

The issue is able being able to be noticied of encoding errors. 
Currently, unencodable characters are silently replaced and you don't 
know if the filename is valid or not. If a UnicodeEncodeError is raised, 
you will be noticed and so you have to fix the problem.

Anyway, you must use the Unicode API on Windows. If you use the Unicode 
API, filenames are no more encoded and code pages are no more used, so 
bye bye Unicode errors!

The Windows bytes API is just kept for backward compatibility. More 
details in my email to python-dev:
http://mail.python.org/pipermail/python-dev/2011-October/114203.html

----------

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


More information about the Python-bugs-list mailing list