[Python-Dev] locale and LC_NUMERIC (original) (raw)

"Martin v. Löwis" martin at v.loewis.de
Mon Jan 9 22:56:12 CET 2006


Neal Norwitz wrote:

neal at janus ~/build/python/svn/clean-ish $ LCALL=deDE ./python

import locale locale.setlocale(locale.LCALL) 'C' locale.setlocale(locale.LCALL, 'deDE') 'deDE' I would have expected the first call to setlocale() to return deDE.

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.

Is the first call to setlocale() supposed to return C? If so, always?

The return value is implementation-defined, but yes, it is supposed to return the "C" locale (which is synonymous to the "POSIX" locale on a POSIX system).

I was looking for some way for the initial call to setlocale() to return deDE or whatever other locale I set.

That shouldn't happen.

Regards, Martin



More information about the Python-Dev mailing list