]> code.ossystems Code Review - openembedded-core.git/commitdiff
buildhistory_analysis: Convert stream data (bytes) to strings
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Wed, 25 May 2016 09:19:34 +0000 (04:19 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 2 Jun 2016 07:10:04 +0000 (08:10 +0100)
The bytes type variables are threat different as strings variables in python3,
so convert bytes to strings. This was found when using the
script buildhistory-diff, where the interpreter was yielding this error

    TypeError: Type str doesn't support the buffer API

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/buildhistory_analysis.py

index 0dcd49f4f17e28b567365f7e3bece5cde02639f2..16491a96e1ed6901e4f55bac0fa159d9b0443dfc 100644 (file)
@@ -190,7 +190,7 @@ class FileChange:
 
 
 def blob_to_dict(blob):
-    alines = blob.data_stream.read().splitlines()
+    alines = [line.decode() for line in blob.data_stream.read().splitlines()]
     adict = {}
     for line in alines:
         splitv = [i.strip() for i in line.split('=',1)]