locale.nl_langinfo(RADIXCHAR) vs locale.localeconv()['decimal_point']
jepler at unpythonic.net
Sat Aug 30 04:12:59 CEST 2003
I'd expect these two to be identical, but they don't seem to be.
[This session from 2.2.2 on RedHat Linux 9; same behavior in 2.3b1]
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "fr_FR")
>>> # Okay, we *are* in France now
>>> # Yep, they use this in place of the decimal point
>>> # But not if you use nl_langinfo() !?
I know that Python plays some nasty games under the covers with
LC_NUMERIC, but I would expect the "emulated" LC_NUMERIC to extend
to locale.nl_langinfo(). The documentation (doc/lib/module-locale.html
or pydoc locale) doesn't reflect this limitation of nl_langinfo() as
far as I can tell.
Should I file an SF bug over this, am I confused about what's going on,
or will this likely be fixed anyway in 6.4? It's not a pressing need
for me, since code can just use localeconv() anyway (or locale.atof and
friends, for that matter)...
More information about the Python-list