reassign 369689 python2.3 thanks
Given issue originally reported against fail2ban package. I've tried to
track the issue -- installed en_DK locales on my box and got the same
problem with simple sequence of calls mentioned below.
My current settings after
LANG=en_DK
LANGUAGE=en_DK:en_US:en_GB:en
LC_ALL=en_DK
> locale
LANG=en_DK
LANGUAGE=en_US:en_GB:en
LC_CTYPE="en_DK"
LC_NUMERIC="en_DK"
LC_TIME="en_DK"
LC_COLLATE="en_DK"
LC_MONETARY="en_DK"
LC_MESSAGES="en_DK"
LC_PAPER="en_DK"
LC_NAME="en_DK"
LC_ADDRESS="en_DK"
LC_TELEPHONE="en_DK"
LC_MEASUREMENT="en_DK"
LC_IDENTIFICATION="en_DK"
LC_ALL=en_DK
in python:
import locale
import time
print `locale.setlocale(locale.LC_ALL,'')`
print time.strptime('May 31 09:30:01', '%b %d %H:%M:%S')
it seems that the call "locale.setlocale(locale.LC_ALL,'')"
sets locale in a way so that locale module later reports missing en_DK
locale for some reason...
Traceback (most recent call last):
File "tmp/test_locale.py", line 8, in ?
print time.strptime('May 31 09:30:01', '%b %d %H:%M:%S')
File "/usr/lib/python2.3/_strptime.py", line 402, in ?
_locale_cache = TimeRE()
File "/usr/lib/python2.3/_strptime.py", line 318, in __init__
self.locale_time = LocaleTime()
File "/usr/lib/python2.3/_strptime.py", line 106, in __init__
self.__lang = _getlang()
File "/usr/lib/python2.3/_strptime.py", line 31, in _getlang
return locale.getlocale(locale.LC_TIME)
File "/usr/lib/python2.3/locale.py", line 365, in getlocale
return _parse_localename(localename)
File "/usr/lib/python2.3/locale.py", line 280, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: en_DK
although that locale is really present (I didn't observe similar
behaviour with en_US or ru_RU locale though).
--
.-.
=------------------------------ /v\ ----------------------------=
Keep in touch // \\ (yoh@|www.)onerussian.com
Yaroslav Halchenko /( )\ ICQ#: 60653192
Linux User ^^-^^ [175555]
pgpyqQCfvjSf8.pgp
Description: PGP signature

