[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: common issue: setlocale handling?



OoO La  nuit ayant déjà  recouvert d'encre ce  jour du dimanche  22 août
2010, vers 23:16, Floris Bruynooghe <flub@devork.be> disait :

>> Perl spits  out a  lot of  annoying warnings when  using a  non existing
>> locale. And it does this for any perl script.
>> 
>> perl: warning: Setting locale failed.
>> perl: warning: Please check that your locale settings:
>> LANGUAGE = (unset),
>> LC_ALL = (unset),
>> LANG = "jhfjkghf"
>> are supported and installed on your system.
>> perl: warning: Falling back to the standard locale ("C").
>> 
>> However, I don't say that the problem  does not exist in Python. I see a
>> lot those kind of errors with Perl because I log into servers that don't
>> have my locale  installed. There is not much to do  because ssh does not
>> allow to  remove some  variables from environment  that have  been added
>> server side (with AcceptEnv). It would be better to switch silently to C
>> locale than to display a lot of useless warnings or just stop.

> Using the standard warnings module this would only happen once for
> each python script.

This would be a real pain! Incorrect locales should just be ignored.
-- 
Use the fundamental control flow constructs.
            - The Elements of Programming Style (Kernighan & Plauger)

Attachment: pgpPNEtdXzU5r.pgp
Description: PGP signature


Reply to: