summaryrefslogtreecommitdiffstats
path: root/meta
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-16 10:37:57 +0000
commit7a308a79196576e8d80f2e2b46141d150d2e8229 (patch)
treeb69e57d304c2fbb60bb627156ed1737a186b5555 /meta
parent6a1ef8a965f6c5747edd7d7463f13fa394fd1436 (diff)
downloadpoky-7a308a79196576e8d80f2e2b46141d150d2e8229.tar.gz
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] (From OE-Core rev: ddbab61f47efd9b4fde38ef8f0f3482c78abe37c) (From OE-Core rev: 8364558a2904d21c9b31d29bfb8f2d9cbeac8659) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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):
647 return 647 return
648 648
649 tmpdir = d.getVar('TMPDIR', True) 649 tmpdir = d.getVar('TMPDIR', True)
650 with open(path) as f: 650 with open(path, 'rb') as f:
651 file_content = f.read() 651 file_content = f.read().decode('utf-8', errors='ignore')
652 if tmpdir in file_content: 652 if tmpdir in file_content:
653 package_qa_add_message(messages, "buildpaths", "File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d)) 653 package_qa_add_message(messages, "buildpaths", "File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d))
654 654