projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8f0d0b7
)
Avoid UnicodeEncodeError in writemsg(). Thanks to Markos Chandras
author
Zac Medico
<zmedico@gentoo.org>
Tue, 4 Aug 2009 18:09:46 +0000
(18:09 -0000)
committer
Zac Medico
<zmedico@gentoo.org>
Tue, 4 Aug 2009 18:09:46 +0000
(18:09 -0000)
<hwoarang@gentoo.org> for reporting.
svn path=/main/trunk/; revision=13900
pym/portage/util.py
patch
|
blob
|
history
diff --git
a/pym/portage/util.py
b/pym/portage/util.py
index 49eec6492c6bc69fe9ef34c05e7bbc8b53947d83..f1bff1d4086869e51bf6bb6274240c30aaf77e4b 100644
(file)
--- a/
pym/portage/util.py
+++ b/
pym/portage/util.py
@@
-56,6
+56,9
@@
def writemsg(mystr,noiselevel=0,fd=None):
if fd is None:
fd = sys.stderr
if noiselevel <= noiselimit:
+ if sys.hexversion < 0x3000000 and isinstance(mystr, unicode):
+ # avoid potential UnicodeEncodeError
+ mystr = mystr.encode('utf_8', 'replace')
fd.write(mystr)
fd.flush()