unknown locale de_DE at euro

Martin v. Löwis loewis at informatik.hu-berlin.de
Sat May 11 03:34:35 EDT 2002


"vincent wehren" <v.wehren at home.nl> writes:

> The locale de_DE at euro  (which I uses ISO-8859-15 as encoding), as used by
> e.g. SuSe 8.0 Linux,is not (yet) regognized by the locale module of
> Python2.2. A ValueError is raised when calling the module's
> "getdefaultlocale()" method. How can one go about handling this? Should one
> add it to the encoding aliases in locale.py? Any suggestions?

I recommend to either ignore or fix locale.getdefaultlocale; as is, it
is utterly broken.

Why do you need it? If you want to obtain the locale's charset, use
locale.nl_langinfo(locale.CODESET) (after performing setlocale).

HTH,
Martin



More information about the Python-list mailing list