[Patches] [ python-Patches-1553427 ] locale.getdefaultlocale() bug when _locale is missing

SourceForge.net noreply at sourceforge.net
Wed Sep 6 16:00:57 CEST 2006


Patches item #1553427, was opened at 2006-09-06 16:00
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1553427&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: STINNER Victor (haypo)
Assigned to: Nobody/Anonymous (nobody)
Summary: locale.getdefaultlocale() bug when _locale is missing

Initial Comment:
locale.getdefaultlocale() is not able to get my 
terminal charset when _locale is missing.

My variable environement (I'm using Kubuntu Dapper):
$ env|egrep '(LANG|LC_)'
LANG=fr_FR.UTF-8
LANGUAGE=fr_FR:fr:en_GB:en

The problem is that locale.getdefaultlocale() try to 
use $LANGUAGE before $LANG, and $LANGUAGE don't 
contain charset information.

So I choosed to test LANGUAGE as last change, and 
backport Python 2.5c1 patch (just use first language 
from $LANGUAGE: localename = localename.split(':')
[0]).

The bug should be in Python 2.x (at least 2.4.x and 
2.5.x).

Haypo

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1553427&group_id=5470


More information about the Patches mailing list