unknown locale de_DE at euro

Sean 'Shaleh' Perry shalehperry at attbi.com
Sat May 11 10:42:50 EDT 2002


On 11-May-2002 Martin v. Löwis wrote:
> "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).
> 

Because many non US linux dists are now shipping with their default lang set to
foo_FOO at euro.  Which means python dies when someone uses it without first
changing their locale.





More information about the Python-list mailing list