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

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 t

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,

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 (met

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 u

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 > > (meth

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 w

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 L

Re: [Python-Dev] locale and LC_NUMERIC

2006-01-08 Thread Martin v. Löwis
Fredrik Lundh wrote: > maybe it would be a good idea to add a "use setlocale" flag to the test- > runner ? Sure! Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python

Re: [Python-Dev] locale and LC_NUMERIC

2006-01-08 Thread Martin v. Löwis
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 LC_CTYPE in the env't the locale isn't set without > me 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.

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. %-fo

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 exec

[Python-Dev] locale and LC_NUMERIC

2006-01-08 Thread Georg Brandl
Hi, >>> 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. regards, Georg __