[ python-Bugs-1177674 ] error locale.getlocale() with LANGUAGE=eu_ES

SourceForge.net noreply at sourceforge.net
Wed Apr 6 15:42:21 CEST 2005


Bugs item #1177674, was opened at 2005-04-06 10:59
Message generated for change (Comment added) made by zunbeltz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1177674&group_id=5470

Category: Python Library
Group: None
Status: Closed
Resolution: Wont Fix
Priority: 5
Submitted By: Zunbeltz Izaola (zunbeltz)
Assigned to: Nobody/Anonymous (nobody)
Summary: error locale.getlocale() with LANGUAGE=eu_ES

Initial Comment:
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

----------------------------------------------------------------------

>Comment By: Zunbeltz Izaola (zunbeltz)
Date: 2005-04-06 13:42

Message:
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)

----------------------------------------------------------------------

Comment By: Hye-Shik Chang (perky)
Date: 2005-04-06 13:08

Message:
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']


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1177674&group_id=5470


More information about the Python-bugs-list mailing list