summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorOlof Johansson <olof.johansson@axis.com>2018-07-16 17:05:56 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-18 10:18:42 +0100
commita24e8944e76dd6647a810a4a509b2dca0e3e86af (patch)
tree0deb94b83316e04de9d4bfc9124259c05c47e25e /meta
parent83b3e1463a4e8c6ab16ecc559ef7e3f793c5ba86 (diff)
downloadpoky-a24e8944e76dd6647a810a4a509b2dca0e3e86af.tar.gz
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 <olofjn@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/spdx.bbclass2
1 files changed, 1 insertions, 1 deletions
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):
208def hash_string(data): 208def hash_string(data):
209 import hashlib 209 import hashlib
210 sha1 = hashlib.sha1() 210 sha1 = hashlib.sha1()
211 sha1.update(data) 211 sha1.update(data.encode('utf-8'))
212 return sha1.hexdigest() 212 return sha1.hexdigest()
213 213
214def run_fossology(foss_command, full_spdx): 214def run_fossology(foss_command, full_spdx):