Encode the hash input as ascii if needed (windows only?)

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2014-08-12 08:40:14 +02:00
parent ce5d8a919f
commit d65fee9303

View File

@@ -16,7 +16,10 @@ import glob
json_options = {'indent' : 2, 'sort_keys' : True}
def get_hash(data):
return hashlib.sha224(data).hexdigest()
try:
return hashlib.sha224(data).hexdigest()
except TypeError:
return hashlib.sha224(data.encode('ascii')).hexdigest()
# unicode
repo_root_path = os.path.normpath(os.path.join(os.path.abspath(__file__), '..', '..'))