From: Leonardo Sandoval Date: Thu, 9 Jun 2016 12:53:06 +0000 (-0500) Subject: lib/oe/terminal.py: decode bytes variable before rstrip/split X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~25428 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b950539c911b7945d652b05616164828e711ac7f;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git lib/oe/terminal.py: decode bytes variable before rstrip/split On python 3, bytes variable types must be decoded if these are intended to be used as strings, otherwise we get the following error exception: TypeError: Type str doesn't support the buffer API Signed-off-by: Leonardo Sandoval Signed-off-by: Ross Burton --- diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py index dc25d14ff68..7f4458ea335 100644 --- a/meta/lib/oe/terminal.py +++ b/meta/lib/oe/terminal.py @@ -246,7 +246,7 @@ def check_terminal_version(terminalName): newenv["LANG"] = "C" p = sub.Popen(['sh', '-c', cmdversion], stdout=sub.PIPE, stderr=sub.PIPE, env=newenv) out, err = p.communicate() - ver_info = out.rstrip().split('\n') + ver_info = out.decode().rstrip().split('\n') except OSError as exc: import errno if exc.errno == errno.ENOENT: