Re: [Python-Dev] locale and LC_NUMERIC

2006-01-09 Thread Neal Norwitz
On 1/8/06, Martin v. Löwis [EMAIL PROTECTED] wrote: Neal Norwitz wrote: I know very little about locale's. /f assigned me a bug http://python.org/sf/1391872 which suggests I run all the tests in a different locale than C. I think this is a good idea, but when I set LANG or LC_ALL or

Re: [Python-Dev] locale and LC_NUMERIC

2006-01-09 Thread Fredrik Lundh
Neal Norwitz wrote: I feel I'm lacking some link here: why do you think we should do that? [EMAIL PROTECTED] ~/build/python/svn/clean-ish $ LC_ALL=de_DE ./python import locale locale.setlocale(locale.LC_ALL) 'C' locale.setlocale(locale.LC_ALL, 'de_DE') 'de_DE' I would have expected

Re: [Python-Dev] locale and LC_NUMERIC

2006-01-09 Thread Neal Norwitz
On 1/8/06, Martin v. Löwis [EMAIL PROTECTED] wrote: Georg Brandl wrote: import locale locale.setlocale(locale.LC_NUMERIC, ) '[EMAIL PROTECTED]' u%f % 1.0 u'1,00' Is this intended? This breaks test_format on my box when test_builtin (method test_float_with_comma) is

Re: [Python-Dev] locale and LC_NUMERIC

2006-01-09 Thread Benji York
Fredrik Lundh wrote: my rationale for running the tests with a non-US locale was to increase the chance of catching bugs where the external locale setting affects Python's behaviour. maybe it would be a good idea to add a use setlocale flag to the test- runner ? Sounds like a good use for

Re: [Python-Dev] locale and LC_NUMERIC

2006-01-09 Thread Georg Brandl
Martin v. Löwis wrote: Georg Brandl wrote: import locale locale.setlocale(locale.LC_NUMERIC, ) '[EMAIL PROTECTED]' %f % 1.0 '1.00' u%f % 1.0 u'1,00' Is this intended? This breaks test_format on my box when test_builtin (method test_float_with_comma) is executed

Re: [Python-Dev] locale and LC_NUMERIC

2006-01-09 Thread Martin v. Löwis
Neal Norwitz wrote: [EMAIL PROTECTED] ~/build/python/svn/clean-ish $ LC_ALL=de_DE ./python import locale locale.setlocale(locale.LC_ALL) 'C' locale.setlocale(locale.LC_ALL, 'de_DE') 'de_DE' I would have expected the first call to setlocale() to return de_DE. No, it shouldn't. We

Re: [Python-Dev] locale and LC_NUMERIC

2006-01-09 Thread Martin v. Löwis
Georg Brandl wrote: 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

Re: [Python-Dev] locale and LC_NUMERIC

2006-01-09 Thread Neal Norwitz
On 1/9/06, Martin v. Löwis [EMAIL PROTECTED] wrote: I would have expected the first call to setlocale() to return de_DE. No, it shouldn't. We are providing C semantics here, which is that no locale functionality is activated unless the application explicitly asks for it. Thanks (to /f

Re: [Python-Dev] locale and LC_NUMERIC

2006-01-08 Thread Martin v. Löwis
Georg Brandl wrote: import locale locale.setlocale(locale.LC_NUMERIC, ) '[EMAIL PROTECTED]' %f % 1.0 '1.00' u%f % 1.0 u'1,00' Is this intended? This breaks test_format on my box when test_builtin (method test_float_with_comma) is executed first. No. %-formatting

Re: [Python-Dev] locale and LC_NUMERIC

2006-01-08 Thread Neal Norwitz
On 1/8/06, Martin v. Löwis [EMAIL PROTECTED] wrote: Georg Brandl wrote: %f % 1.0 '1.00' u%f % 1.0 u'1,00' 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

Re: [Python-Dev] locale and LC_NUMERIC

2006-01-08 Thread Fredrik Lundh
Neal Norwitz wrote: No. %-formatting should always use the C locale. One should use locale.format to get locale-aware formatting. I know very little about locale's. /f assigned me a bug http://python.org/sf/1391872 which suggests I run all the tests in a different locale than C. I think