[gnome-continuous-yocto/gnomeostree-3.28-rocko: 699/8267] scripts: python3: decode subprocess output
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 699/8267] scripts: python3: decode subprocess output
- Date: Sat, 16 Dec 2017 20:47:34 +0000 (UTC)
commit 4e36eeee7797ed1e3418b3ccb81797211edab573
Author: Ed Bartosh <ed bartosh linux intel com>
Date: Thu Jun 2 13:13:00 2016 +0300
scripts: python3: decode subprocess output
stdeout and stderr content returned by subprocess API has different
types in Python 3(bytes) and Python 2(string). Decoding it to
'utf-8' makes it unicode on both pythons.
(From OE-Core rev: ae4d36375683b6cfd48af25bfca70b2e77f7ade5)
Signed-off-by: Ed Bartosh <ed bartosh linux intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
scripts/cleanup-workdir | 2 +-
scripts/combo-layer | 2 +-
scripts/oe-selftest | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/scripts/cleanup-workdir b/scripts/cleanup-workdir
index fee464c..0b2cf99 100755
--- a/scripts/cleanup-workdir
+++ b/scripts/cleanup-workdir
@@ -45,7 +45,7 @@ def run_command(cmd):
if pipe.returncode != 0:
print("Execute command '%s' failed." % cmd)
sys.exit(1)
- return output
+ return output.decode('utf-8')
def get_cur_arch_dirs(workdir, arch_dirs):
pattern = workdir + '/(.*?)/'
diff --git a/scripts/combo-layer b/scripts/combo-layer
index 36a8f5f..eaa7f5a 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -198,7 +198,7 @@ def runcmd(cmd,destdir=None,printerr=True,out=None,env=None):
raise e
err.seek(0)
- output = err.read()
+ output = err.read().decode('utf-8')
logger.debug("output: %s" % output.replace(chr(0), '\\0'))
return output
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index b1ecf7f..df76f94 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -371,7 +371,7 @@ def coverage_setup(coverage_source, coverage_include, coverage_omit):
import subprocess
builddir = os.environ.get("BUILDDIR")
pokydir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
- curcommit= subprocess.check_output(["git", "--git-dir", os.path.join(pokydir, ".git"), "rev-parse",
"HEAD"])
+ curcommit= subprocess.check_output(["git", "--git-dir", os.path.join(pokydir, ".git"), "rev-parse",
"HEAD"]).decode('utf-8')
coveragerc = "%s/.coveragerc" % builddir
data_file = "%s/.coverage." % builddir
data_file += datetime.datetime.now().strftime('%Y%m%dT%H%M%S')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]