From 6863bd7b2e64d65251bb3f9935477cb020ccef91 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Wed, 29 Apr 2015 19:08:05 -0700 Subject: [PATCH] bintree.py: do not pass unicode encoding with non-string type unicode() cannot specify an encoding when converting arbitrary objects such as exceptions. Doing so results in a TypeError. Fixes commit 4496ee37d6fa327ada635c67500e82f830141a9e. X-Gentoo-Bug: 532784 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=532784 --- pym/portage/dbapi/bintree.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index b37f388..3057d9d 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -961,8 +961,7 @@ class binarytree(object): # With Python 2, the EnvironmentError message may # contain bytes or unicode, so use _unicode to ensure # safety with all locales (bug #532784). - writemsg("!!! %s\n\n" % _unicode(e, - _encodings["stdio"], errors="replace")) + writemsg("!!! %s\n\n" % _unicode(e)) del e pkgindex = None if proc is not None: -- 2.0.5