summaryrefslogtreecommitdiff
path: root/meta/classes
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2016-11-01 05:44:46 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-06 23:35:17 +0000
commitddbab61f47efd9b4fde38ef8f0f3482c78abe37c (patch)
treeb41e73d8d55edb6c5c2a5a9c3c61768e7ff41e00 /meta/classes
parent42d5781e31c5bf76b5b7e27abed4f6f3fd65bf40 (diff)
downloadopenembedded-core-ddbab61f47efd9b4fde38ef8f0f3482c78abe37c.tar.gz
openembedded-core-ddbab61f47efd9b4fde38ef8f0f3482c78abe37c.tar.bz2
openembedded-core-ddbab61f47efd9b4fde38ef8f0f3482c78abe37c.zip
insane.bbclass:buildpaths: open() file with 'rb'
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> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/insane.bbclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 1d73778255..a5c93f33ff 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -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))