bitbake: toaster: use decode('utf-8') for binary data

Decoded binary data to utf-8 to fix the following
error when runnign on python 3:
TypeError: Type str doesn't support the buffer API

[YOCTO #9584]

(Bitbake rev: 752ea00919ef054622a51ce097923309934eff2b)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh
2016-05-10 15:28:50 +03:00
committed by Richard Purdie
parent 46ed4fff34
commit 96ce543150
3 changed files with 3 additions and 3 deletions

View File

@@ -70,7 +70,7 @@ class LocalhostBEController(BuildEnvironmentController):
raise ShellCmdException(err)
else:
logger.debug("localhostbecontroller: shellcmd success")
return out
return out.decode('utf-8')
def getGitCloneDirectory(self, url, branch):
"""Construct unique clone directory name out of url and branch."""

View File

@@ -54,7 +54,7 @@ class Command(BaseCommand):
(out,err) = cmd.communicate()
if cmd.returncode != 0:
logging.warning("Error while importing layer vcs_url: git error: %s" % err)
for line in out.split("\n"):
for line in out.decode('utf-8').split("\n"):
try:
(name, path) = line.split("\t", 1)
if name == remote_name:

View File

@@ -1169,7 +1169,7 @@ class LayerIndexLayerSource(LayerSource):
except URLError as e:
raise Exception("Failed to read %s: %s" % (path, e.reason))
return json.loads(res.read())
return json.loads(res.read().decode('utf-8'))
# verify we can get the basic api
try: