Bug #1417699: Reject locale-specific decimal point in float()

and atof().
This commit is contained in:
Martin v. Löwis 2006-07-03 12:19:50 +00:00
parent 82c276ea33
commit fcfff0a7fa
4 changed files with 27 additions and 3 deletions

View file

@ -113,6 +113,9 @@ class _LocaleTests(unittest.TestCase):
"using eval('3.14') failed for %s" % loc)
self.assertEquals(int(float('3.14') * 100), 314,
"using float('3.14') failed for %s" % loc)
if localeconv()['decimal_point'] != '.':
self.assertRaises(ValueError, float,
localeconv()['decimal_point'].join(['1', '23']))
def test_main():
run_unittest(_LocaleTests)