diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2016-11-01 05:44:46 -0700 |
---|---|---|
committer | Koen Kooi <koen.kooi@linaro.org> | 2017-03-17 09:44:57 +0100 |
commit | df5639b0308480fcaf14c51dbc206241c76eb18a (patch) | |
tree | 5450ade09a42a1fd60e3318a583bbbbb88f39132 | |
parent | f6df34b77345026608f0f170b48a7234f6c15f97 (diff) |
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)
Change-Id: I8b64a8098953ea5b14191dcdacb3a1cb70e8b80a
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>
-rw-r--r-- | meta-ilp32/classes/insane.bbclass | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta-ilp32/classes/insane.bbclass b/meta-ilp32/classes/insane.bbclass index 1db7b8ac..f27d4358 100644 --- a/meta-ilp32/classes/insane.bbclass +++ b/meta-ilp32/classes/insane.bbclass @@ -650,8 +650,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)) |