Commits

Matthias Klose  committed 2c280e4

- 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.

  • Participants
  • Parent commits afdadd5
  • Branches 2.4

Comments (0)

Files changed (2)

File Lib/locale.py

     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).
     for variable in envvars:
         localename = lookup(variable,None)
         if localename:
+            if variable == 'LANGUAGE':
+                localename = localename.split(':')[0]
             break
     else:
         localename = 'C'
 Library
 -------
 
+- 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.
+
 - Patch #1268314: Cache lines in StreamReader.readlines for performance.
 
 - Bug #1290505: time.strptime() was not invalidating its regex cache when the