mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00:00
recipetool: fix encoding-related errors creating python recipes
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. (From OE-Core rev: 103faae78cdff5280c7b7cdb7ca01e0868d02ec9) (From OE-Core rev: f9e0267a64069fa2488ceb7ca1f6dbe5bfb66c18) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
e8b00a62b1
commit
1dcc0ab902
@@ -512,7 +512,7 @@ class PythonRecipeHandler(RecipeHandler):
|
|||||||
except (OSError, subprocess.CalledProcessError):
|
except (OSError, subprocess.CalledProcessError):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
for line in dep_output.decode('utf-8').splitlines():
|
for line in dep_output.splitlines():
|
||||||
line = line.rstrip()
|
line = line.rstrip()
|
||||||
dep, filename = line.split('\t', 1)
|
dep, filename = line.split('\t', 1)
|
||||||
if filename.endswith('/setup.py'):
|
if filename.endswith('/setup.py'):
|
||||||
@@ -591,7 +591,7 @@ class PythonRecipeHandler(RecipeHandler):
|
|||||||
if 'stderr' not in popenargs:
|
if 'stderr' not in popenargs:
|
||||||
popenargs['stderr'] = subprocess.STDOUT
|
popenargs['stderr'] = subprocess.STDOUT
|
||||||
try:
|
try:
|
||||||
return subprocess.check_output(cmd, **popenargs)
|
return subprocess.check_output(cmd, **popenargs).decode('utf-8')
|
||||||
except OSError as exc:
|
except OSError as exc:
|
||||||
logger.error('Unable to run `{}`: {}', ' '.join(cmd), exc)
|
logger.error('Unable to run `{}`: {}', ' '.join(cmd), exc)
|
||||||
raise
|
raise
|
||||||
|
|||||||
Reference in New Issue
Block a user