summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-04 22:45:47 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-04 22:45:47 +0000
commit8198822a832c81d2346ef2725bad39022a7497cb (patch)
treee886550385743f1bc8d90d78269bcc8790447626
parent3e09e6650f904a155add470b37b8e332decc4f35 (diff)
downloadportage-8198822a832c81d2346ef2725bad39022a7497cb.tar.gz
portage-8198822a832c81d2346ef2725bad39022a7497cb.tar.bz2
portage-8198822a832c81d2346ef2725bad39022a7497cb.zip
Avoid UnicodeEncodeError with unicode package.mask comments. Thanks to
Thanks to Scott Moreau (soreau) for reporting. svn path=/main/trunk/; revision=13910
-rw-r--r--pym/_emerge/depgraph.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 2b944ee51..aba41de41 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -5111,6 +5111,11 @@ def show_masked_packages(masked_packages):
pass
print "- "+cpv+" (masked by: "+", ".join(mreasons)+")"
+
+ if sys.hexversion < 0x3000000 and isinstance(comment, unicode):
+ # avoid potential UnicodeEncodeError
+ comment = comment.encode('utf_8', 'replace')
+
if comment and comment not in shown_comments:
print filename+":"
print comment