From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 00C67138330 for ; Wed, 14 Sep 2016 23:14:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 64D85E0BA4; Wed, 14 Sep 2016 23:14:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B9DCCE0B60 for ; Wed, 14 Sep 2016 23:14:37 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7CB0C34092E for ; Wed, 14 Sep 2016 23:14:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 96D6C247A for ; Wed, 14 Sep 2016 23:14:34 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1473890027.3f8f3263a316159359d4137d77c7be2c80fc9d57.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/util/locale.py X-VCS-Directories: pym/portage/util/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 3f8f3263a316159359d4137d77c7be2c80fc9d57 X-VCS-Branch: master Date: Wed, 14 Sep 2016 23:14:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 296d07fc-7d2b-4bc5-847e-d2d19b3cfbe7 X-Archives-Hash: 3dc91c6b10519998f501d4240151ac3b commit: 3f8f3263a316159359d4137d77c7be2c80fc9d57 Author: Anthony G. Basile gentoo org> AuthorDate: Wed May 25 12:48:32 2016 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Wed Sep 14 21:53:47 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=3f8f3263 pym/portage/util/locale.py: fix decoding for python2 plus some locales When using python2 with some locales, like turkish, chr() is passed values not in range(128) which cannot be decoded as ASCII, thus throwing a UnicodeDecodeError exception. We use _unicode_decode() from portage.util to address this. Signed-off-by: Anthony G. Basile gentoo.org> pym/portage/util/locale.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pym/portage/util/locale.py b/pym/portage/util/locale.py index 2a15ea1..093eb86 100644 --- a/pym/portage/util/locale.py +++ b/pym/portage/util/locale.py @@ -15,7 +15,7 @@ import textwrap import traceback import portage -from portage.util import writemsg_level +from portage.util import _unicode_decode, writemsg_level from portage.util._ctypes import find_library, LoadLibrary @@ -62,7 +62,7 @@ def _check_locale(silent): "as LC_CTYPE in make.conf.") msg = [l for l in textwrap.wrap(msg, 70)] msg.append("") - chars = lambda l: ''.join(chr(x) for x in l) + chars = lambda l: ''.join(_unicode_decode(chr(x)) for x in l) if uc != ruc: msg.extend([ " %s -> %s" % (chars(lc), chars(ruc)),