]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
insane.bbclass:buildpaths: open() file with 'rb' rbt/bp
authorRobert Yang <liezhi.yang@windriver.com>
Tue, 1 Nov 2016 12:25:46 +0000 (05:25 -0700)
committerRobert Yang <liezhi.yang@windriver.com>
Tue, 1 Nov 2016 12:43:50 +0000 (05:43 -0700)
open() is default to 'rt' which may cause decoding errors when open
binary file:
$ bitbake xcursor-transparent-theme
[snip]
Exception: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfd in position 18: invalid start byte
[snip]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
meta/classes/insane.bbclass

index 1d73778255a6227c31ba599db291977bc18a95e3..a5c93f33ff53872e5120c530fddd8bdaa4097f48 100644 (file)
@@ -647,8 +647,8 @@ def package_qa_check_buildpaths(path, name, d, elf, messages):
         return
 
     tmpdir = d.getVar('TMPDIR', True)
-    with open(path) as f:
-        file_content = f.read()
+    with open(path, 'rb') as f:
+        file_content = f.read().decode('utf-8', errors='ignore')
         if tmpdir in file_content:
             package_qa_add_message(messages, "buildpaths", "File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d))