From 6b88e803a9d2c81dac848d7e7e06fa0db5beef55 Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Fri, 10 Jul 2020 00:10:12 +0200 Subject: [PATCH] Fixed usage of hashlib for sha256 hash --- redirect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redirect.py b/redirect.py index 5a80e24..24cac49 100755 --- a/redirect.py +++ b/redirect.py @@ -119,7 +119,7 @@ def checkFile(source_file, mapping): old_url = old_match.group(0) verb(f"{line}") if mirror_mode: - mirror_file = mirror_path / (hashlib.sha256(old_pattern.pattern) + ".lst") + mirror_file = mirror_path / (hashlib.sha256(old_pattern.pattern.encode('utf-8')).hexdigest() + ".lst") new_line = old_pattern.sub('mirror+file:' + str(mirror_file.resolve()), line) if write_mode: if not mirror_path.exists():