From 176e2c74b368c73b593553773e749b3f25ddad72 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 25 Mar 2011 13:52:16 -0700 Subject: [PATCH] MergeProcess: handle unicode in elog pipe --- pym/portage/dbapi/_MergeProcess.py | 4 ++-- pym/portage/dbapi/vartree.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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): -- 2.26.2