From fe92d0b0817d083577499f17854779219daa1677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 10 Mar 2008 10:18:53 +0000 Subject: [PATCH] Also set LC_CTYPE, to allow localeconv string conversion. --- Lib/test/test__locale.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Lib/test/test__locale.py b/Lib/test/test__locale.py index 69fc6253b4c..aed273d1e63 100644 --- a/Lib/test/test__locale.py +++ b/Lib/test/test__locale.py @@ -1,5 +1,5 @@ from test.test_support import verbose, TestSkipped, run_unittest -from _locale import (setlocale, LC_NUMERIC, RADIXCHAR, THOUSEP, nl_langinfo, +from _locale import (setlocale, LC_ALL, LC_CTYPE, LC_NUMERIC, RADIXCHAR, THOUSEP, nl_langinfo, localeconv, Error) import unittest from platform import uname @@ -28,10 +28,10 @@ known_numerics = {'fr_FR' : (',', ''), 'en_US':('.', ',')} class _LocaleTests(unittest.TestCase): def setUp(self): - self.oldlocale = setlocale(LC_NUMERIC) + self.oldlocale = setlocale(LC_ALL) def tearDown(self): - setlocale(LC_NUMERIC, self.oldlocale) + setlocale(LC_ALL, self.oldlocale) # Want to know what value was calculated, what it was compared against, # what function was used for the calculation, what type of data was used, @@ -58,6 +58,7 @@ class _LocaleTests(unittest.TestCase): for loc in candidate_locales: try: setlocale(LC_NUMERIC, loc) + setlocale(LC_CTYPE, loc) except Error: continue for li, lc in ((RADIXCHAR, "decimal_point"), @@ -69,6 +70,7 @@ class _LocaleTests(unittest.TestCase): for loc in candidate_locales: try: setlocale(LC_NUMERIC, loc) + setlocale(LC_CTYPE, loc) except Error: continue for li, lc in ((RADIXCHAR, "decimal_point"), @@ -80,6 +82,7 @@ class _LocaleTests(unittest.TestCase): for loc in candidate_locales: try: setlocale(LC_NUMERIC, loc) + setlocale(LC_CTYPE, loc) except Error: continue for li, lc in ((RADIXCHAR, "decimal_point"), @@ -102,6 +105,7 @@ class _LocaleTests(unittest.TestCase): for loc in candidate_locales: try: setlocale(LC_NUMERIC, loc) + setlocale(LC_CTYPE, loc) except Error: continue