[issue38324] [Windows] test_locale and test__locale failures on Windows
STINNER Victor
report at bugs.python.org
Mon Feb 10 17:43:44 EST 2020
STINNER Victor <vstinner at python.org> added the comment:
Details on this error:
ERROR: test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\vstinner\python\3.8\lib\test\test_locale.py", line 567, in test_getsetlocale_issue1813
locale.setlocale(locale.LC_CTYPE, loc)
File "C:\vstinner\python\3.8\lib\locale.py", line 608, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
On Windows 10 (version 1903), ANSI code page 1252, OEM code page 437, LC_CTYPE locale "French_France.1252":
vstinner at WIN C:\vstinner\python\master>python
Running Debug|x64 interpreter...
Python 3.9.0a3+ (heads/master:d68e0a8a16, Feb 10 2020, 22:59:58) [MSC v.1916 64
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_CTYPE, "tr_TR")
'tr_TR'
>>> loc=locale.getlocale(locale.LC_CTYPE)
>>> loc
('tr_TR', 'ISO8859-9')
>>> locale.setlocale(locale.LC_CTYPE, loc)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\vstinner\python\master\lib\locale.py", line 610, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
>>> name=locale._build_localename(loc)
>>> name
'tr_TR.ISO8859-9'
>>> name2 = locale.normalize(name)
>>> name2 == name
True
>>> name2
'tr_TR.ISO8859-9'
>>> locale.setlocale(locale.LC_CTYPE, 'tr_TR.ISO8859-9')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\vstinner\python\master\lib\locale.py", line 610, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
Note: I changed the OEM code page, usually OEM cp is 850, but the OEM code page should have no effect on setlocale().
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38324>
_______________________________________
More information about the Python-bugs-list
mailing list