diff options
| author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-05-10 15:28:50 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-16 23:32:41 +0100 |
| commit | 4fe7e92056d662598d105f2e89f944fd1c981c2c (patch) | |
| tree | 282a072ab70371194f9d31ae486a1ef3dbec3c0d | |
| parent | f555272aa83535f9a5620ef1ec8bec93ce1fac96 (diff) | |
| download | poky-4fe7e92056d662598d105f2e89f944fd1c981c2c.tar.gz | |
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: 49c203bfe4083122d2954a97b4f8bb7959711a19)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 2 | ||||
| -rw-r--r-- | bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py | 2 | ||||
| -rw-r--r-- | bitbake/lib/toaster/orm/models.py | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py index b4e41968f1..3da8be4358 100644 --- a/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +++ b/bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | |||
| @@ -70,7 +70,7 @@ class LocalhostBEController(BuildEnvironmentController): | |||
| 70 | raise ShellCmdException(err) | 70 | raise ShellCmdException(err) |
| 71 | else: | 71 | else: |
| 72 | logger.debug("localhostbecontroller: shellcmd success") | 72 | logger.debug("localhostbecontroller: shellcmd success") |
| 73 | return out | 73 | return out.decode('utf-8') |
| 74 | 74 | ||
| 75 | def getGitCloneDirectory(self, url, branch): | 75 | def getGitCloneDirectory(self, url, branch): |
| 76 | """Construct unique clone directory name out of url and branch.""" | 76 | """Construct unique clone directory name out of url and branch.""" |
diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py index 6d25df9e54..173e3ce579 100644 --- a/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py +++ b/bitbake/lib/toaster/bldcontrol/management/commands/loadconf.py | |||
| @@ -54,7 +54,7 @@ class Command(BaseCommand): | |||
| 54 | (out,err) = cmd.communicate() | 54 | (out,err) = cmd.communicate() |
| 55 | if cmd.returncode != 0: | 55 | if cmd.returncode != 0: |
| 56 | logging.warning("Error while importing layer vcs_url: git error: %s" % err) | 56 | logging.warning("Error while importing layer vcs_url: git error: %s" % err) |
| 57 | for line in out.split("\n"): | 57 | for line in out.decode('utf-8').split("\n"): |
| 58 | try: | 58 | try: |
| 59 | (name, path) = line.split("\t", 1) | 59 | (name, path) = line.split("\t", 1) |
| 60 | if name == remote_name: | 60 | if name == remote_name: |
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 9183b0cd7c..58dc753aef 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
| @@ -1169,7 +1169,7 @@ class LayerIndexLayerSource(LayerSource): | |||
| 1169 | except URLError as e: | 1169 | except URLError as e: |
| 1170 | raise Exception("Failed to read %s: %s" % (path, e.reason)) | 1170 | raise Exception("Failed to read %s: %s" % (path, e.reason)) |
| 1171 | 1171 | ||
| 1172 | return json.loads(res.read()) | 1172 | return json.loads(res.read().decode('utf-8')) |
| 1173 | 1173 | ||
| 1174 | # verify we can get the basic api | 1174 | # verify we can get the basic api |
| 1175 | try: | 1175 | try: |
