Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/
Date: Sun, 22 Nov 2015 20:54:04
Message-Id: 1448225487.59f2371c58ea6942ad441d8238600c21cda1c014.zmedico@gentoo
1 commit: 59f2371c58ea6942ad441d8238600c21cda1c014
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 22 20:51:10 2015 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 22 20:51:27 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=59f2371c
7
8 portage.util.locale: fix python2.7 setlocale ValueError (bug 566372)
9
10 The locale.setlocale function raises ValueError with python2.7 if it
11 is given a unicode argument.
12
13 X-Gentoo-Bug: 566372
14 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=566372
15
16 pym/portage/util/locale.py | 4 +++-
17 1 file changed, 3 insertions(+), 1 deletion(-)
18
19 diff --git a/pym/portage/util/locale.py b/pym/portage/util/locale.py
20 index 05b3979..2a15ea1 100644
21 --- a/pym/portage/util/locale.py
22 +++ b/pym/portage/util/locale.py
23 @@ -14,6 +14,7 @@ import os
24 import textwrap
25 import traceback
26
27 +import portage
28 from portage.util import writemsg_level
29 from portage.util._ctypes import find_library, LoadLibrary
30
31 @@ -102,7 +103,8 @@ def check_locale(silent=False, env=None):
32 try:
33 if env is not None:
34 try:
35 - locale.setlocale(locale.LC_CTYPE, mylocale)
36 + locale.setlocale(locale.LC_CTYPE,
37 + portage._native_string(mylocale))
38 except locale.Error:
39 os._exit(2)