[Python-checkins] python/dist/src/Lib locale.py,1.28.4.1,1.28.4.2
doko@users.sourceforge.net
doko at users.sourceforge.net
Tue Sep 20 09:03:24 CEST 2005
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5971/Lib
Modified Files:
Tag: release24-maint
locale.py
Log Message:
- Patch #1166948: locale.py: Prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE
to get the correct encoding.
- Patch #1166938: locale.py: Parse LANGUAGE as a colon separated list of
languages.
Index: locale.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/locale.py,v
retrieving revision 1.28.4.1
retrieving revision 1.28.4.2
diff -u -d -r1.28.4.1 -r1.28.4.2
--- locale.py 1 Jan 2005 06:12:26 -0000 1.28.4.1
+++ locale.py 20 Sep 2005 07:03:21 -0000 1.28.4.2
@@ -293,7 +293,7 @@
else:
return language + '.' + encoding
-def getdefaultlocale(envvars=('LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LANG')):
+def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
""" Tries to determine the default locale settings and returns
them as tuple (language code, encoding).
@@ -338,6 +338,8 @@
for variable in envvars:
localename = lookup(variable,None)
if localename:
+ if variable == 'LANGUAGE':
+ localename = localename.split(':')[0]
break
else:
localename = 'C'
More information about the Python-checkins
mailing list