classification
Title: test__locale fails
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, mwh
Priority: normal Keywords:

Created on 2004-09-07 16:18 by mwh, last changed 2004-09-08 02:03 by brett.cannon. This issue is now closed.

Messages (2)
msg22383 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2004-09-07 16:18
This is a bit strange.

$ ./python ../Lib/test/regrtest.py test__locale
test__locale
test test__locale failed -- Traceback (most recent call
last):
  File
"/home/mwh/src/python/dist/src/Lib/test/test__locale.py",
line 37, in test_lc_numeric
    "%r != %r (%s); "
  File "/home/mwh/src/python/dist/src/Lib/locale.py",
line 363, in getlocale
    return _parse_localename(localename)
  File "/home/mwh/src/python/dist/src/Lib/locale.py",
line 278, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: lv_LV

1 test failed:
    test__locale
[13925 refs]

Redhat 9, CVS as of a few minutes ago.

The same problem, interactively:

>>> import _locale, locale
[27114 refs]
>>> _locale.setlocale(_locale.LC_NUMERIC, 'lv_LV')
'lv_LV'
[27155 refs]
>>> locale.getlocale(locale.LC_NUMERIC)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/home/mwh/src/python/dist/src/Lib/locale.py",
line 363, in getlocale
    return _parse_localename(localename)
  File "/home/mwh/src/python/dist/src/Lib/locale.py",
line 278, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: lv_LV
[27170 refs]

setlocale() succeeds but subsequent getlocale()s fail,
it seems.

The test failure is fairly new, but the behaviour may
be older, I guess.
msg22384 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2004-09-08 02:03
Logged In: YES 
user_id=357491

Fixed in rev 1.8 .  Problem was from when I moved test__locale over to 
unittest.  Now it uses setlocale and guards against the lookup failing.
History
Date User Action Args
2004-09-07 16:18:27mwhcreate