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

Re: common issue: setlocale handling?



On Sun, Aug 22, 2010 at 02:16:21PM +0200, Vincent Bernat wrote:
> OoO En cette  matinée ensoleillée du dimanche 22  août 2010, vers 09:44,
> Paul Wise <pabs@debian.org> disait :
> 
> >> I don't think this is a bug at all. I'd rather say it's an user error.
> 
> > I disagree, stuff written in C or Perl doesn't crash when the locale
> > is not set properly and neither should stuff written in Python.
> 
> 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 sounds like the more sensible behaviour, but
it sounds like it should be fixed upstream so that the unguarded
setlocale just shows this behaviour.  If everyone here agrees with
that maybe someone should ask python to consider this?

Regards
Floris


-- 
Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org


Reply to: