Marc-Andre Lemburg <m...@egenix.com> added the comment:

Martin v. Löwis wrote:
> 
> Martin v. Löwis <mar...@v.loewis.de> added the comment:
> 
> getdefaultlocale is inherently unmaintainable, and shouldn't be used by 
> applications. I wish it was removed from Python (but unfortunately, too many 
> people got tricked into believing that it does something useful).

I disagree on that.

getdefaultlocale() provides a way to access the default locale
(and encoding) on a platform without requiring a call to
setlocale(LC_ALL, "") which would affect the currently running
application and is not thread-safe (just like most other locale
C APIs in the C lib).

getpreferredencoding() just provides encoding information. It doesn't
provide locale information, so I don't see how that could be used
as replacement for getdefaultlocale().

The table needed for normalizing the various locale strings used in
the LANG environment variable (and others) needs to be updated every
now and then, but that's natural for a resource that changes based
on what people use locales for in real life.

> That said, if anybody feels like updating the tables from the various data 
> sources, please go ahead.

I last updated the table in 2008. Will do that again this week.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8374>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to