Martin v. Löwis wrote:
> Georg Brandl wrote:
>> >>> import locale
>> >>> locale.setlocale(locale.LC_NUMERIC, "")
>> '[EMAIL PROTECTED]'
>> >>> "%f" % 1.0
>> '1.000000'
>> >>> u"%f" % 1.0
>> u'1,000000'
>> >>>
>>
>>
>> Is this intended? This breaks test_format on my box when test_builtin (method
>> test_float_with_comma) is executed first.
>
> No. %-formatting should always use the C locale. One should use
> locale.format to get locale-aware formatting.
While we're at it: test_builtin does
import locale
orig_locale = locale.setlocale(locale.LC_NUMERIC, '')
locale.setlocale(locale.LC_NUMERIC, 'fr_FR')
and later
finally:
locale.setlocale(locale.LC_NUMERIC, orig_locale)
Shouldn't the first setlocale have no second argument?
regards,
Georg
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com