public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Brian Dolbec <dolsen@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Subject: Re: [gentoo-portage-dev] [PATCH v2] bintree.py: fix str() calls for Python 2 (532784)
Date: Wed, 17 Dec 2014 13:42:49 -0800	[thread overview]
Message-ID: <20141217134249.07963170.dolsen@gentoo.org> (raw)
In-Reply-To: <1418839162-23865-1-git-send-email-zmedico@gentoo.org>

On Wed, 17 Dec 2014 09:59:22 -0800
Zac Medico <zmedico@gentoo.org> 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 <dolsen>



      reply	other threads:[~2014-12-17 21:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-17 17:36 [gentoo-portage-dev] [PATCH] bintree.py: fix str() calls for Python 2 (532784) Zac Medico
2014-12-17 17:59 ` [gentoo-portage-dev] [PATCH v2] " Zac Medico
2014-12-17 21:42   ` Brian Dolbec [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141217134249.07963170.dolsen@gentoo.org \
    --to=dolsen@gentoo.org \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox