This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients aronacher, loewis, vstinner
Date 2011-03-17.22:02:37
SpamBayes Score 3.752585e-09
Marked as misclassified No
Message-id <1300399357.78.0.357210194346.issue11574@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-03-17 22:02:37vstinnersetrecipients: + vstinner, loewis, aronacher
2011-03-17 22:02:37vstinnersetmessageid: <1300399357.78.0.357210194346.issue11574@psf.upfronthosting.co.za>
2011-03-17 22:02:37vstinnerlinkissue11574 messages
2011-03-17 22:02:37vstinnercreate