Message18007
Python 2.3 (#1, Jul 30 2003, 11:19:43)
[GCC 3.2] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import locale as lo
>>> lo.setlocale(lo.LC_ALL, 'de')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.3/locale.py", line 381, in
setlocale
return _setlocale(category, locale)
locale.Error: locale setting not supported
The above was taken from the example section of the
locale module documentation.
But this works:
>>> lo.setlocale(lo.LC_ALL, 'de_DE')
'de_DE'
>>>
So the error message should at least be changed to
"unknown/unsupported locale" and the documentation
example updated to 'de_DE' instead of 'de'.
However, if there are no side effects, I'd prefer to
change the locale.setlocale() implementation to always
normalize() the locale:
def setlocale(category, locale=None):
if locale:
if type(locale) is not type(""):
# convert to string
locale = _build_localename(locale)
locale = normalize(locale)
return _setlocale(category, locale)
|
|
Date |
User |
Action |
Args |
2007-08-23 14:16:33 | admin | link | issue797447 messages |
2007-08-23 14:16:33 | admin | create | |
|