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.

classification
Title: error locale.getlocale() with LANGUAGE=eu_ES
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: hyeshik.chang, zunbeltz
Priority: normal Keywords:

Created on 2005-04-06 10:59 by zunbeltz, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg24911 - (view) Author: Zunbeltz Izaola (zunbeltz) Date: 2005-04-06 10:59
My LANGUAGE is set tu eu_ES but the getlocale() 
output is (None, None).
This is check with the command

python -c "import locale; print locale.getlocale()"

python version 2.4
os. linux - ubuntu
msg24912 - (view) Author: Hyeshik Chang (hyeshik.chang) * (Python committer) Date: 2005-04-06 13:08
Logged In: YES 
user_id=55188

It's an intended behavior and conforms POSIX standard.
locale doesn't set until program calls locale.setlocale()
explicitly.

miffy(perky):~% LC_ALL=ko_KR.UTF-8 python
Python 2.4 (#2, Feb  4 2005, 12:07:54)
[GCC 3.4.2 [FreeBSD] 20040728] on freebsd5
Type "help", "copyright", "credits" or "license" for more
information.
>>> import locale
>>> locale.getlocale()
(None, None)
>>> locale.setlocale(locale.LC_ALL, '')
'ko_KR.UTF-8'
>>> locale.getlocale()
['ko_KR', 'utf']
msg24913 - (view) Author: Zunbeltz Izaola (zunbeltz) Date: 2005-04-06 13:42
Logged In: YES 
user_id=1139116

Sorry. The example is wrong. If I execute the comands you show
(setlocale() and them getlocale()) I get the following error

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/locale.py", line 365, in getlocale
    return _parse_localename(localename)
  File "/usr/lib/python2.4/locale.py", line 278, in
_parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: eu_ES

(I find this error when i want to use pybliographic and it
use setlocale before getlocale)
History
Date User Action Args
2022-04-11 14:56:10adminsetgithub: 41811
2005-04-06 10:59:49zunbeltzcreate