Commit f3f231f6 authored by Matthias Klose's avatar Matthias Klose

- 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.
parent ba3e6ec0
...@@ -306,7 +306,7 @@ def _build_localename(localetuple): ...@@ -306,7 +306,7 @@ def _build_localename(localetuple):
else: else:
return language + '.' + encoding 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 """ Tries to determine the default locale settings and returns
them as tuple (language code, encoding). them as tuple (language code, encoding).
...@@ -351,6 +351,8 @@ def getdefaultlocale(envvars=('LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LANG')): ...@@ -351,6 +351,8 @@ def getdefaultlocale(envvars=('LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LANG')):
for variable in envvars: for variable in envvars:
localename = lookup(variable,None) localename = lookup(variable,None)
if localename: if localename:
if variable == 'LANGUAGE':
localename = localename.split(':')[0]
break break
else: else:
localename = 'C' localename = 'C'
......
...@@ -224,6 +224,12 @@ Extension Modules ...@@ -224,6 +224,12 @@ Extension Modules
Library 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. - Patch #1268314: Cache lines in StreamReader.readlines for performance.
- Bug #1290505: Fix clearing the regex cache for time.strptime(). - Bug #1290505: Fix clearing the regex cache for time.strptime().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment