mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 12:49:46 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
6a1ef8a965
commit
7a308a7919
@@ -647,8 +647,8 @@ def package_qa_check_buildpaths(path, name, d, elf, messages):
|
|||||||
return
|
return
|
||||||
|
|
||||||
tmpdir = d.getVar('TMPDIR', True)
|
tmpdir = d.getVar('TMPDIR', True)
|
||||||
with open(path) as f:
|
with open(path, 'rb') as f:
|
||||||
file_content = f.read()
|
file_content = f.read().decode('utf-8', errors='ignore')
|
||||||
if tmpdir in file_content:
|
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))
|
package_qa_add_message(messages, "buildpaths", "File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user