STINNER Victor <victor.stin...@haypocalc.com> added the comment: In my experience (PYTHONFSENCODING, sys.setfilesystemencoding()): Python should just use the same encoding than the locale encoding because *all* other programs on the system use the locale encoding. If none of LANG, LC_ALL or LC_CTYPE env var is set: Python does use ASCII just because nl_langinfo() answers ASCII.
Said differently: get_codeset() doesn't fail if there is no environment variable. If get_codeset() does fail: Python stops immediatly with a fatal error, it doesn't fallback to ASCII or something like that. Python < 3.2 used ASCII at startup until the locale encoding codec was loaded (to avoid a bootstrap issue). But I fixed the bootstrap issue in Python 3.2: Python does now *always* use the locale encoding, even at startup. Before the codec is complelty loaded: Python uses _Py_char2wchar() to decode filenames (and other data). For more information, see also a previous attempt: issue #8725. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11574> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com