commit: 59f2371c58ea6942ad441d8238600c21cda1c014 Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Sun Nov 22 20:51:10 2015 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Sun Nov 22 20:51:27 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=59f2371c
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 pym/portage/util/locale.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pym/portage/util/locale.py b/pym/portage/util/locale.py index 05b3979..2a15ea1 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)
