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)

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>
This commit is contained in:
Robert Yang 2016-11-01 05:44:46 -07:00 committed by Richard Purdie
parent 2b1cbb43ae
commit 970436f546
1 changed files with 2 additions and 2 deletions

View 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))