[oe-commits] [openembedded-core] 21/47: insane.bbclass:buildpaths: open() file with 'rb'
git at git.openembedded.org
git at git.openembedded.org
Wed Nov 16 10:39:25 UTC 2016
rpurdie pushed a commit to branch morty
in repository openembedded-core.
commit 8364558a2904d21c9b31d29bfb8f2d9cbeac8659
Author: Robert Yang <liezhi.yang at windriver.com>
AuthorDate: Tue Nov 1 05:44:46 2016 -0700
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 at windriver.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
meta/classes/insane.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 1d73778..a5c93f3 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))
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list