[issue25812] locale.nl_langinfo() can't decode value
Nina Zakharenko
report at bugs.python.org
Thu Jun 2 21:14:14 EDT 2016
Nina Zakharenko added the comment:
Adding the test below to test__locale.py will reproduce the issue under the following conditions:
- The locale `uk_UA` is installed on your system.
- 'uk_UA': (',', '\xa0') is added to the `known_numerics` dictionary in this test file
@unittest.skipUnless(nl_langinfo, "nl_langinfo is not available")
def test_lc_numeric_not_char_nl_langinfo(self):
# Test nl_langinfo against known values/
# It should still work if there's a mismatch between
# String & Numeric Locales
tested = False
for loc in candidate_locales:
try:
setlocale(LC_NUMERIC, loc)
except Error:
continue
for li, lc in ((RADIXCHAR, "decimal_point"),
(THOUSEP, "thousands_sep")):
if self.numeric_tester('nl_langinfo', nl_langinfo(li), lc, loc):
tested = True
if not tested:
self.skipTest('no suitable locales')
----------
nosy: +nnja
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25812>
_______________________________________
More information about the Python-bugs-list
mailing list