mirror of
https://git.yoctoproject.org/poky
synced 2026-04-18 12:32:12 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
83b3e1463a
commit
a24e8944e7
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user