From: Zac Medico Date: Fri, 25 Mar 2011 20:52:16 +0000 (-0700) Subject: MergeProcess: handle unicode in elog pipe X-Git-Tag: v2.2.0_alpha29~20 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=176e2c74b368c73b593553773e749b3f25ddad72;p=portage.git MergeProcess: handle unicode in elog pipe --- diff --git a/pym/portage/dbapi/_MergeProcess.py b/pym/portage/dbapi/_MergeProcess.py index 5caeef372..b5c45b36d 100644 --- a/pym/portage/dbapi/_MergeProcess.py +++ b/pym/portage/dbapi/_MergeProcess.py @@ -7,7 +7,7 @@ import traceback import errno import fcntl import portage -from portage import os, StringIO +from portage import os, StringIO, _unicode_decode import portage.elog.messages from _emerge.PollConstants import PollConstants from _emerge.SpawnProcess import SpawnProcess @@ -32,7 +32,7 @@ class MergeProcess(SpawnProcess): if e.errno not in (errno.EAGAIN, errno.EINTR): raise if output: - lines = output.split('\n') + lines = _unicode_decode(output).split('\n') if len(lines) == 1: self._buf += lines[0] else: diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 0e60af82a..d463c3a5e 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -2802,7 +2802,7 @@ class dblink(object): buffer.append(' '.join(fields)) buffer.append('\n') if buffer: - os.write(self._pipe, ''.join(buffer)) + os.write(self._pipe, _unicode_encode(''.join(buffer))) def treewalk(self, srcroot, destroot, inforoot, myebuild, cleanup=0, mydbapi=None, prev_mtimes=None):