summaryrefslogtreecommitdiffstats
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:13:30 +0100
commitb06a44f1081ea422a365e80bc79b2aeb2783d23f (patch)
treeda43313bc734b090b22ff61df9ae7e5d12bb7c8e
parent978f5a8f16bf5942aad73d761df2a00aeb36339d (diff)
downloadopenembedded-core-contrib-b06a44f1081ea422a365e80bc79b2aeb2783d23f.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. Signed-off-by: Olof Johansson <olofjn@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-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):
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):