[issue16162] Py_FileSystemDefaultEncoding should be updated on locale.setlocale()

Martin v. Löwis report at bugs.python.org
Mon Oct 8 17:43:22 CEST 2012


Martin v. Löwis added the comment:

It actually *is* possible to work with UTF-8-encoded file names even in an ASCII locale. It should work automatically, using the PEP 383 mechanism.

I'm -0 on allowing changes to the file system encoding. It may lead to mojibake, if some file names were read from the file system before the locale was changed, and then accessed later.

I don't understand why you think that it is, in some cases, impossible to pass environment variables. In case of dbus activiation, it is surely possible to pass environment variables somehow. The easiest solution should be to put

#!/bin/sh
s=''''
LANG=en_US.UTF-8 exec /usr/bin/python $0 "$@"
'''

into the beginning of the script.

----------
nosy: +loewis

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


More information about the Python-bugs-list mailing list