[gnome-continuous-yocto/gnomeostree-3.28-rocko: 3230/8267] insane.bbclass:buildpaths: open() file with 'rb'
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 3230/8267] insane.bbclass:buildpaths: open() file with 'rb'
- Date: Sun, 17 Dec 2017 00:20:30 +0000 (UTC)
commit 970436f546bc73f31c0692eb3aecc134c96433a9
Author: Robert Yang <liezhi yang windriver com>
Date: 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 windriver com>
Signed-off-by: Ross Burton <ross burton intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
meta/classes/insane.bbclass | 4 ++--
1 files 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))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]