This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: locale.getdefaultlocale fails with empty env. variable
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: doko, loewis
Priority: normal Keywords: patch

Created on 2004-05-28 22:27 by doko, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg46091 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2004-05-28 22:27
[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:
msg46092 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-07-26 12:46
Logged In: YES 
user_id=21627

Thanks for the patch. Applied as locale.py 1.28 and 1.25.10.1.
History
Date User Action Args
2022-04-11 14:56:04adminsetgithub: 40303
2004-05-28 22:27:12dokocreate