From e91d892a9bb3bec5b16389ff1435cd90195cea7a Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Thu, 2 Aug 2018 00:01:42 +0200 Subject: [PATCH] py3: fix sha1 hashing --- lib/galaxy/util/hash_util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/util/hash_util.py b/lib/galaxy/util/hash_util.py index 7e042544dc7..d9e4e6978e8 100644 --- a/lib/galaxy/util/hash_util.py +++ b/lib/galaxy/util/hash_util.py @@ -8,6 +8,9 @@ import hashlib import hmac import logging +from . import smart_str + + log = logging.getLogger(__name__) BLOCK_SIZE = 1024 * 1024 @@ -55,7 +58,7 @@ def new_secure_hash(text_type=None): hexdigest of the sha1 hash of the argument `text_type`. """ if text_type: - return sha1(text_type).hexdigest() + return sha1(smart_str(text_type)).hexdigest() else: return sha1()