aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2015-11-22 12:51:10 -0800
committerZac Medico <zmedico@gentoo.org>2015-11-22 12:51:27 -0800
commit59f2371c58ea6942ad441d8238600c21cda1c014 (patch)
treea0084a9a21b81560b108cd59b560deff80a9b4df
parentportage.util.locale: enable absolute_import (bug 566372) (diff)
downloadportage-59f2371c58ea6942ad441d8238600c21cda1c014.tar.gz
portage-59f2371c58ea6942ad441d8238600c21cda1c014.tar.bz2
portage-59f2371c58ea6942ad441d8238600c21cda1c014.zip
portage.util.locale: fix python2.7 setlocale ValueError (bug 566372)
The locale.setlocale function raises ValueError with python2.7 if it is given a unicode argument. X-Gentoo-Bug: 566372 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=566372
-rw-r--r--pym/portage/util/locale.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pym/portage/util/locale.py b/pym/portage/util/locale.py
index 05b39798e..2a15ea1b1 100644
--- a/pym/portage/util/locale.py
+++ b/pym/portage/util/locale.py
@@ -14,6 +14,7 @@ import os
import textwrap
import traceback
+import portage
from portage.util import writemsg_level
from portage.util._ctypes import find_library, LoadLibrary
@@ -102,7 +103,8 @@ def check_locale(silent=False, env=None):
try:
if env is not None:
try:
- locale.setlocale(locale.LC_CTYPE, mylocale)
+ locale.setlocale(locale.LC_CTYPE,
+ portage._native_string(mylocale))
except locale.Error:
os._exit(2)