aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-12-05 07:50:24 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-12-05 11:10:40 +1300
commit8f4183151be62ae0b19cef9975993af141c17790 (patch)
tree7fe765412277aa1bd4af78e42bcbed0c728e1080
parent11063a01d4511b2688ea7ba2d7359e4e07328c66 (diff)
downloadopenembedded-core-contrib-paule/recipetool-fixes7.tar.gz
openembedded-core-contrib-paule/recipetool-fixes7.tar.bz2
openembedded-core-contrib-paule/recipetool-fixes7.zip
recipetool: fix encoding-related errors creating python recipespaule/recipetool-fixes7
Yet another instance of us expecting a string back from subprocess when in Python 3 what you get back is bytes. Just decode the output within run_command() so we avoid this everywhere. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
-rw-r--r--scripts/lib/recipetool/create_buildsys_python.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py
index e41d81a317..82a2be1224 100644
--- a/scripts/lib/recipetool/create_buildsys_python.py
+++ b/scripts/lib/recipetool/create_buildsys_python.py
@@ -512,7 +512,7 @@ class PythonRecipeHandler(RecipeHandler):
except (OSError, subprocess.CalledProcessError):
pass
else:
- for line in dep_output.decode('utf-8').splitlines():
+ for line in dep_output.splitlines():
line = line.rstrip()
dep, filename = line.split('\t', 1)
if filename.endswith('/setup.py'):
@@ -591,7 +591,7 @@ class PythonRecipeHandler(RecipeHandler):
if 'stderr' not in popenargs:
popenargs['stderr'] = subprocess.STDOUT
try:
- return subprocess.check_output(cmd, **popenargs)
+ return subprocess.check_output(cmd, **popenargs).decode('utf-8')
except OSError as exc:
logger.error('Unable to run `{}`: {}', ' '.join(cmd), exc)
raise