[Python-checkins] r42479 - python/trunk/Lib/test/test__locale.py

neal.norwitz python-checkins at python.org
Sun Feb 19 01:13:16 CET 2006


Author: neal.norwitz
Date: Sun Feb 19 01:13:15 2006
New Revision: 42479

Modified:
   python/trunk/Lib/test/test__locale.py
Log:
This fixes test _locale failing on macteagle (Mac OS 10.4 AFAIK).

Google for:  eu_ES decimal point
shows that BSD locales had the eu_ES decimal point as
a single quote (') instead of a comma (,).

This was seems to have been fixed 15 months ago, but it's not on our
Mac and presumably others.  So skip this broken locale.



Modified: python/trunk/Lib/test/test__locale.py
==============================================================================
--- python/trunk/Lib/test/test__locale.py	(original)
+++ python/trunk/Lib/test/test__locale.py	Sun Feb 19 01:13:15 2006
@@ -96,7 +96,6 @@
                                                 nl_radixchar, li_radixchar,
                                                 loc, set_locale))
 
-
     def test_float_parsing(self):
         # Bug #1391872: Test whether float parsing is okay on European
         # locales.
@@ -105,13 +104,16 @@
                 setlocale(LC_NUMERIC, loc)
             except Error:
                 continue
+
+            # Ignore buggy locale databases. (Mac OS 10.4 and some other BSDs)
+            if loc == 'eu_ES' and localeconv()['decimal_point'] == "' ":
+                continue
+
             self.assertEquals(int(eval('3.14') * 100), 314,
                                 "using eval('3.14') failed for %s" % loc)
             self.assertEquals(int(float('3.14') * 100), 314,
                                 "using float('3.14') failed for %s" % loc)
 
-
-
 def test_main():
     run_unittest(_LocaleTests)
 


More information about the Python-checkins mailing list