Message131290
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. |
|
Date |
User |
Action |
Args |
2011-03-17 22:02:37 | vstinner | set | recipients:
+ vstinner, loewis, aronacher |
2011-03-17 22:02:37 | vstinner | set | messageid: <1300399357.78.0.357210194346.issue11574@psf.upfronthosting.co.za> |
2011-03-17 22:02:37 | vstinner | link | issue11574 messages |
2011-03-17 22:02:37 | vstinner | create | |
|