]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #13441: Don't test the hu_HU locale on Solaris to workaround a mbstowcs()
authorVictor Stinner <victor.stinner@haypocalc.com>
Fri, 9 Dec 2011 00:20:03 +0000 (01:20 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Fri, 9 Dec 2011 00:20:03 +0000 (01:20 +0100)
bug. On Solaris, if the locale is hu_HU (and if the locale encoding is not
UTF-8), the thousauds separator is b'\xA0' which is decoded as U+30000020
instead of U+0020 by mbstowcs().

Lib/test/test__locale.py

index 19bca68fd0a1242c9fd3ce2bf2fc6012af76cf24..3217f7114b77f3af55ba22ac183f7bf722585b93 100644 (file)
@@ -17,7 +17,7 @@ if uname()[0] == "Darwin":
 candidate_locales = ['es_UY', 'fr_FR', 'fi_FI', 'es_CO', 'pt_PT', 'it_IT',
     'et_EE', 'es_PY', 'no_NO', 'nl_NL', 'lv_LV', 'el_GR', 'be_BY', 'fr_BE',
     'ro_RO', 'ru_UA', 'ru_RU', 'es_VE', 'ca_ES', 'se_NO', 'es_EC', 'id_ID',
-    'ka_GE', 'es_CL', 'hu_HU', 'wa_BE', 'lt_LT', 'sl_SI', 'hr_HR', 'es_AR',
+    'ka_GE', 'es_CL', 'wa_BE', 'lt_LT', 'sl_SI', 'hr_HR', 'es_AR',
     'es_ES', 'oc_FR', 'gl_ES', 'bg_BG', 'is_IS', 'mk_MK', 'de_AT', 'pt_BR',
     'da_DK', 'nn_NO', 'cs_CZ', 'de_LU', 'es_BO', 'sq_AL', 'sk_SK', 'fr_CH',
     'de_DE', 'sr_YU', 'br_FR', 'nl_BE', 'sv_FI', 'pl_PL', 'fr_CA', 'fo_FO',
@@ -25,6 +25,13 @@ candidate_locales = ['es_UY', 'fr_FR', 'fi_FI', 'es_CO', 'pt_PT', 'it_IT',
     'eu_ES', 'vi_VN', 'af_ZA', 'nb_NO', 'en_DK', 'tg_TJ', 'en_US',
     'es_ES.ISO8859-1', 'fr_FR.ISO8859-15', 'ru_RU.KOI8-R', 'ko_KR.eucKR']
 
+# Issue #13441: Don't test the hu_HU locale on Solaris to workaround a
+# mbstowcs() bug. On Solaris, if the locale is hu_HU (and if the locale
+# encoding is not UTF-8), the thousauds separator is b'\xA0' which is decoded
+# as U+30000020 instead of U+0020 by mbstowcs().
+if sys.platform != 'sunos5':
+    candidate_locales.append('hu_HU')
+
 # Workaround for MSVC6(debug) crash bug
 if "MSC v.1200" in sys.version:
     def accept(loc):