From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 35EFF1389E2 for ; Wed, 17 Dec 2014 21:43:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 24D13E0854; Wed, 17 Dec 2014 21:43:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A8CEDE07F7 for ; Wed, 17 Dec 2014 21:43:22 +0000 (UTC) Received: from big_daddy.dol-sen.ca (S010634bdfa9ecf80.vc.shawcable.net [96.49.31.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dolsen) by smtp.gentoo.org (Postfix) with ESMTPSA id D38673405F2 for ; Wed, 17 Dec 2014 21:43:21 +0000 (UTC) Date: Wed, 17 Dec 2014 13:42:49 -0800 From: Brian Dolbec To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] [PATCH v2] bintree.py: fix str() calls for Python 2 (532784) Message-ID: <20141217134249.07963170.dolsen@gentoo.org> In-Reply-To: <1418839162-23865-1-git-send-email-zmedico@gentoo.org> References: <1418837765-22607-1-git-send-email-zmedico@gentoo.org> <1418839162-23865-1-git-send-email-zmedico@gentoo.org> Organization: Gentoo Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archives-Salt: 57959ffd-de5e-4076-bded-817302cec991 X-Archives-Hash: 2044b6d834ec4b587b87ccdff9a6e6c4 On Wed, 17 Dec 2014 09:59:22 -0800 Zac Medico wrote: > Avoid a UnicodeDecodeError raised when str(e) converts an exception > to bytes with Python 2. Since this file has unicode_literals enabled, > use literal unicode format strings to format messages for unicode > exceptions. However, with Python 2, an EnvironmentError exception > may contain either bytes or unicode, so use _unicode(errors="replace") > to ensure safety for EnvironmentError with all locales. > > Also, convert remaining str() calls to use _unicode() for uniform > behavior regardless of python version. > > X-Gentoo-Bug: 532784 > X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=532784 > --- > PATCH v2 replaces the _unicode_decode call with > _unicode(errors="replace"), which is required in order to force the > EnvironmentError object to be converted to a unicode string. > Yup, LGTM -- Brian Dolbec