Skip to contentSkip to conversation

bitbake-layers: fix layerindex-fetch for Python 3

PATCH New Paul Eggleton 1 participant 2 messages Mar 20, 2017

lore
Share & tools
lore
#0 lore raw

cover bitbake-layers: fix layerindex-fetch for Python 3

The following changes since commit 1ff9b3c669fa187f152de7b8b57d14c2468d926c:

tests/data: Add inactive remove override test (2017-03-16 12:54:59 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib paule/bblayers-fix
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/bblayers-fix

Paul Eggleton (1):
bitbake-layers: fix layerindex-fetch for Python 3

 lib/bblayers/layerindex.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 bitbake-layers: fix layerindex-fetch for Python 3

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).

---
 lib/bblayers/layerindex.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bblayers/layerindex.py +1 -1
index 013e952..506c110 100644
@@ -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):
Signature · 1 line
2.9.3