From a24e8944e76dd6647a810a4a509b2dca0e3e86af Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Mon, 16 Jul 2018 17:05:56 +0200 Subject: spdx.bbclass: Encode strings before passing to hashlib In python3, passing a unicode object to hashlib will result in an exception that encourages you to encode it first. (From OE-Core rev: b06a44f1081ea422a365e80bc79b2aeb2783d23f) Signed-off-by: Olof Johansson Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/classes/spdx.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'meta/classes/spdx.bbclass') diff --git a/meta/classes/spdx.bbclass b/meta/classes/spdx.bbclass index a3e22afc33..fb78e274a8 100644 --- a/meta/classes/spdx.bbclass +++ b/meta/classes/spdx.bbclass @@ -208,7 +208,7 @@ def hash_file(file_name): def hash_string(data): import hashlib sha1 = hashlib.sha1() - sha1.update(data) + sha1.update(data.encode('utf-8')) return sha1.hexdigest() def run_fossology(foss_command, full_spdx): -- cgit v1.2.3-54-g00ecf