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 lemburg
Recipients BreamoreBoy, docs@python, eric.araujo, ezio.melotti, gjb1002, lemburg, vstinner
Date 2014-06-26.07:51:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1403769093.08.0.0315613941513.issue13074@psf.upfronthosting.co.za>
In-reply-to
Content
The two functions serve a different purpose.

getdefautltlocale() specifically avoids calling setlocale() and is thread-safe on Unix. It's purpose is to return the default locale string, not only the encoding.

getpreferredencoding() only returns the encoding, but on Unix has to call setlocale() to return correct results and thus is not thread-safe.

Martin's comment doesn't address this difference and I don't agree with it.

Regarding the different results, I guess this could be solved by having both function pass the data obtained from the system through _parse_localname() before returning it, but that would have to be a handled in a new issue report.
History
Date User Action Args
2014-06-26 07:51:33lemburgsetrecipients: + lemburg, gjb1002, vstinner, ezio.melotti, eric.araujo, docs@python, BreamoreBoy
2014-06-26 07:51:33lemburgsetmessageid: <1403769093.08.0.0315613941513.issue13074@psf.upfronthosting.co.za>
2014-06-26 07:51:33lemburglinkissue13074 messages
2014-06-26 07:51:32lemburgcreate