Terry J. Reedy added the comment:
locale.getlocale(category=LC_CTYPE)
Returns the current setting for the given locale category as sequence
containing language code, encoding. category may be one of the LC_* values
except LC_ALL. It defaults to LC_CTYPE.
Except for the code 'C',
Eryk Sun added the comment:
> I tried "import locale; locale.getlocale()" on macOS and
> windows (3.10) and linux (3.7) and in all cases I got
> non-None values.
In Windows, starting with Python 3.8, Python sets the LC_CTYPE locale to the
user (not system) default locale instead of the
Irit Katriel added the comment:
I tried "import locale; locale.getlocale()" on macOS and windows (3.10) and
linux (3.7) and in all cases I got non-None values. Can we close this as out
of date?
--
nosy: +iritkatriel
status: open -> pending
___
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +docs@python, eric.araujo
stage: - needs patch
versions: +Python 2.7, Python 3.2, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12726
Terry J. Reedy tjre...@udel.edu added the comment:
Our docs explain behavior without, generally, explaining why. Hence the title
change.
'Returns the current setting for the given locale category' seems pretty clear
that it returns the current program setting rather than the default system
New submission from Alexis Metaireau ale...@notmyidea.org:
The documentation about locale.getlocale() doesn't talk about the fact that the
locale isn't read from the system locale. Thus, it seemed strange to have
locale.getlocale() returning (None, None).
As it seems to be the expected