From 7a308a79196576e8d80f2e2b46141d150d2e8229 Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Tue, 1 Nov 2016 05:44:46 -0700 Subject: 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 Signed-off-by: Ross Burton Signed-off-by: Richard Purdie Signed-off-by: Armin Kuster Signed-off-by: Richard Purdie --- meta/classes/insane.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'meta/classes') 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)) -- cgit v1.2.3-54-g00ecf