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 ezio.melotti, lemburg, methane, vstinner
Date 2022-03-23.12:15:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648037758.12.0.294305161177.issue47000@roundup.psfhosted.org>
In-reply-to
Content
sys.getlocaleencoding() versus locale.getencoding().

For me, the Python locale module should use the C API to access the Unix locales like LC_CTYPE, nl_langinfo(CODESET), etc.

The sys module are more for things specific to Python, like sys.getfilesystemencoding().

Since sys.getlocaleencoding() would be a fixed value for the whole process life time, I agree that the sys module is a better place.

I can write a PR adding sys.getlocaleencoding() if we agree on the API.
History
Date User Action Args
2022-03-23 12:15:58vstinnersetrecipients: + vstinner, lemburg, ezio.melotti, methane
2022-03-23 12:15:58vstinnersetmessageid: <1648037758.12.0.294305161177.issue47000@roundup.psfhosted.org>
2022-03-23 12:15:58vstinnerlinkissue47000 messages
2022-03-23 12:15:58vstinnercreate