[issue6815] UnicodeDecodeError in os.path.expandvars

STINNER Victor report at bugs.python.org
Thu Feb 13 12:05:04 CET 2014


STINNER Victor added the comment:

The changes on ntpath.py are a little bit weird: it uses os.environb, whereas Windows is the only OS where os.environb does not exist. It looks like ntpath is available and tested on UNIX so the change looks to be valid, even you are not supposed to have Windows variables in your UNIX environment :-)

As bytes filenames, we should maybe deprecated bytes environment variables on Windows in Python 3.5. On Windows, the environment is Unicode. The bytes API is just provided for backward compatibility, but it should not be used.

By the way, the initial bug report was on Python 2.

Using os.fsencode/fsdecode instead of the ASCII encoding looks correct.

----------

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


More information about the Python-bugs-list mailing list