[bitbake-devel,1.32] bitbake-layers: fix layerindex-fetch for Python 3

Submitted by Matthew McClintock on Nov. 29, 2017, 10:34 p.m. | Patch ID: 146283

Details

Message ID 20171129223456.13875-1-msm-oss@mcclintock.net
State New
Headers show

Commit Message

Matthew McClintock Nov. 29, 2017, 10:34 p.m.
From: Paul Eggleton <paul.eggleton@linux.intel.com>

The data we read from an HTTPConnection comes in the form of bytes, but
we need it as a string, so in Python 3 we need to decode it (missed in
the Python 3 migration).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bblayers/layerindex.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/lib/bblayers/layerindex.py b/lib/bblayers/layerindex.py
index 10ad718e..f53a47fc 100644
--- a/lib/bblayers/layerindex.py
+++ b/lib/bblayers/layerindex.py
@@ -56,7 +56,7 @@  class LayerIndexPlugin(ActionPlugin):
         r = conn.getresponse()
         if r.status != 200:
             raise Exception("Failed to read " + path + ": %d %s" % (r.status, r.reason))
-        return json.loads(r.read())
+        return json.loads(r.read().decode())
 
     def get_layer_deps(self, layername, layeritems, layerbranches, layerdependencies, branchnum, selfname=False):
         def layeritems_info_id(items_name, layeritems):