summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-09 19:49:00 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-09 19:49:00 +0000
commitacb36ba1ab66c907b17511102768da07264e86d6 (patch)
tree3a7bc09b98090bafa692e898a5936909dcc827e3
parent9939ba64b8b1ddb34e9d51cf266d8c8bd87b48c5 (diff)
downloadportage-acb36ba1ab66c907b17511102768da07264e86d6.tar.gz
portage-acb36ba1ab66c907b17511102768da07264e86d6.tar.bz2
portage-acb36ba1ab66c907b17511102768da07264e86d6.zip
Inside collect_ebuild_messages(), open elog files in text mode (unicode).
Thanks to jlec for reporting. svn path=/main/trunk/; revision=13958
-rw-r--r--pym/portage/elog/messages.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pym/portage/elog/messages.py b/pym/portage/elog/messages.py
index 3b44e0fe8..341f74c0e 100644
--- a/pym/portage/elog/messages.py
+++ b/pym/portage/elog/messages.py
@@ -12,6 +12,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
from portage.const import EBUILD_PHASES
from portage.localization import _
+import codecs
import os
import sys
@@ -40,7 +41,8 @@ def collect_ebuild_messages(path):
logentries[msgfunction] = []
lastmsgtype = None
msgcontent = []
- for l in open(filename):
+ for l in codecs.open(filename, mode='r',
+ encoding='utf_8', errors='replace'):
if not l:
continue
try: