[Patches] [ python-Patches-962487 ] locale.getdefaultlocale fails with empty env. variable

SourceForge.net noreply at sourceforge.net
Fri May 28 18:27:12 EDT 2004


Patches item #962487, was opened at 2004-05-28 22:27
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=962487&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthias Klose (doko)
Assigned to: Nobody/Anonymous (nobody)
Summary: locale.getdefaultlocale fails with empty env. variable

Initial Comment:
[forwarded from http://bugs.debian.org/249816]

When getdefaultlocale receives an empty string in one
of the LANGUAGE,
LC_ALL, LC_CTYPE or LANG variables it passes it to
_parse_localename
function causing a ValueError. It can be easily fixed
by checking the
truth value of the os.environ.get instead of checking
if it's None. The
added patch fixes the problem.

342c342
<         if localename is not None:
---
>         if localename:


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

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



More information about the Patches mailing list