From 19dc1c962ccc1f9a33e05e281f46e2a93eaaed8d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 27 Feb 2009 03:08:03 +0000 Subject: [PATCH] Fix CommandOutputSet to decode binary command output in py3k. svn path=/main/trunk/; revision=12721 --- pym/portage/sets/shell.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pym/portage/sets/shell.py b/pym/portage/sets/shell.py index ba1b2422f..75912c0be 100644 --- a/pym/portage/sets/shell.py +++ b/pym/portage/sets/shell.py @@ -4,6 +4,7 @@ import subprocess import os +import sys from portage.sets.base import PackageSet from portage.sets import SetConfigError @@ -35,8 +36,11 @@ class CommandOutputSet(PackageSet): pipe = subprocess.Popen(self._command, stdout=subprocess.PIPE, shell=True) if pipe.wait() == os.EX_OK: text = pipe.stdout.read() - self._setAtoms(text.split("\n")) - + if sys.hexversion >= 0x3000000: + encoding = sys.getdefaultencoding() + text = text.decode(encoding, 'replace') + self._setAtoms(text.splitlines()) + def singleBuilder(self, options, settings, trees): if not "command" in options: raise SetConfigError("no command specified") -- 2.26.2