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

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.python.patches
Message-ID <[email protected]>
Patches item #1553427, was opened at 2006-09-06 14:00
Message generated for change (Comment added) made by gbrandl
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: Closed
>Resolution: Fixed
Priority: 5
Private: No
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

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

>Comment By: Georg Brandl (gbrandl)
Date: 2007-06-18 19:34

Message:
Logged In: YES 
user_id=849994
Originator: NO

Fixed in 2.5.1 according to the reporter.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1553427&group_id=5470
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.