summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2005-12-29 20:35:52 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2005-12-29 20:35:52 (GMT)
commit24f0fa97c5ed31397f20b094a166de325036e3c2 (patch)
tree982aa4c2c369a9893b9208df4ca36860388e40a9 /Lib
parentb9359c402bdaeefbbd5408af3b29200fc85ceb18 (diff)
downloadcpython-24f0fa97c5ed31397f20b094a166de325036e3c2.zip
cpython-24f0fa97c5ed31397f20b094a166de325036e3c2.tar.gz
cpython-24f0fa97c5ed31397f20b094a166de325036e3c2.tar.bz2
SF#1391872
Floating point literals don't work in non-US locale in 2.5. Patch and new locale tests by Hye-Shik Chang.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test__locale.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test__locale.py b/Lib/test/test__locale.py
index ef4fe8d..abdb87e 100644
--- a/Lib/test/test__locale.py
+++ b/Lib/test/test__locale.py
@@ -97,6 +97,18 @@ class _LocaleTests(unittest.TestCase):
loc, set_locale))
+ def test_float_parsing(self):
+ # Bug #1391872: Test whether float parsing is okay on European
+ # locales.
+ for loc in candidate_locales:
+ try:
+ setlocale(LC_NUMERIC, loc)
+ except Error:
+ continue
+ self.assertEquals(int(eval('3.14') * 100), 314)
+ self.assertEquals(int(float('3.14') * 100), 314)
+
+
def test_main():
run_unittest(_LocaleTests)