Fix Unicode-objects must be encoded before hashing.
This commit is contained in:
arbisoft
2019-08-23 12:04:51 +05:00
parent 0c2f4b793d
commit 4b432c4b48

View File

@@ -284,4 +284,4 @@ def hash_grading_policy(grading_policy):
separators=(',', ':'), # Remove spaces from separators for more compact representation
sort_keys=True,
)
return b64encode(sha1(ordered_policy).digest())
return b64encode(sha1(ordered_policy.encode("utf-8")).digest())