]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/oe/terminal.py: decode bytes variable before rstrip/split
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Thu, 9 Jun 2016 12:53:06 +0000 (07:53 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 12 Jun 2016 22:39:21 +0000 (23:39 +0100)
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 <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oe/terminal.py

index dc25d14ff689ec6fed24752edcc478efc8404af2..7f4458ea33548ca2c435cedef483877a73623cc3 100644 (file)
@@ -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: