summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-22 07:52:43 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-22 07:52:43 +0000
commit9832f811c7b731bfd2d965986cd5a058a9c6c92f (patch)
tree18b90a229d1858a019ca0555a2a9608b68591891
parentb2136c384e68856cba89d1c571f408620e525210 (diff)
downloadportage-9832f811c7b731bfd2d965986cd5a058a9c6c92f.tar.gz
portage-9832f811c7b731bfd2d965986cd5a058a9c6c92f.tar.bz2
portage-9832f811c7b731bfd2d965986cd5a058a9c6c92f.zip
Bug #282269 - Avoid str() calls with overlay paths, which can trigger
UnicodeEncodeError in python-2.x. svn path=/main/trunk/; revision=14124
-rw-r--r--pym/_emerge/RepoDisplay.py4
-rw-r--r--pym/_emerge/depgraph.py4
-rw-r--r--pym/portage/dbapi/porttree.py8
3 files changed, 9 insertions, 7 deletions
diff --git a/pym/_emerge/RepoDisplay.py b/pym/_emerge/RepoDisplay.py
index a954aebfa..e98be93c4 100644
--- a/pym/_emerge/RepoDisplay.py
+++ b/pym/_emerge/RepoDisplay.py
@@ -48,6 +48,10 @@ class RepoDisplay(object):
return s
def __str__(self):
+ """
+ In python-2.x, str() can trigger a UnicodeEncodeError here,
+ so call __str__() directly.
+ """
output = []
shown_repos = self._shown_repos
unknown_repo = self._unknown_repo
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index ebb3bfda4..bd2964f3c 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4370,7 +4370,9 @@ class depgraph(object):
print
print counters
if show_repos:
- writemsg_stdout(str(repo_display), noiselevel=-1)
+ # In python-2.x, str() can trigger a UnicodeEncodeError here,
+ # so call __str__() directly.
+ writemsg_stdout(repo_display.__str__(), noiselevel=-1)
if "--changelog" in self._frozen_config.myopts:
writemsg_stdout('\n', noiselevel=-1)
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 34e9d178e..10baa4b9c 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -604,15 +604,11 @@ class portdbapi(dbapi):
mydata, st, emtime = self._pull_valid_cache(mycpv, myebuild, mylocation)
doregen = mydata is None
- writemsg(_("auxdb is valid: ")+str(not doregen)+" "+str(pkg)+"\n", 2)
-
if doregen:
if myebuild in self._broken_ebuilds:
raise KeyError(mycpv)
if not self._have_root_eclass_dir:
raise KeyError(mycpv)
- writemsg("doregen: %s %s\n" % (doregen, mycpv), 2)
- writemsg(_("Generating cache entry(0) for: ")+str(myebuild)+"\n", 1)
self.doebuild_settings.setcpv(mycpv)
mydata = {}
@@ -831,7 +827,7 @@ class portdbapi(dbapi):
os.path.join(self.mysettings["DISTDIR"], x), mysums[x])
except FileNotFound, e:
ok = False
- reason = _("File Not Found: '%s'") % str(e)
+ reason = _("File Not Found: '%s'") % (e,)
if not ok:
failures[x] = reason
if failures:
@@ -1105,7 +1101,7 @@ class portdbapi(dbapi):
except PortageException, e:
writemsg("!!! Error: aux_get('%s', %s)\n" % (mycpv, aux_keys),
noiselevel=-1)
- writemsg("!!! %s\n" % str(e), noiselevel=-1)
+ writemsg("!!! %s\n" % (e,), noiselevel=-1)
del e
continue
eapi = metadata["EAPI"]