From a56f7e7ecb1da1c021c504d92d00852da4d64b85 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Tue, 5 Nov 2024 05:58:41 +0100 Subject: [PATCH] blogbot: can't hash strings --- zulip_bots/zulip_bots/blogbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zulip_bots/zulip_bots/blogbot.py b/zulip_bots/zulip_bots/blogbot.py index ca86881..3f3289f 100644 --- a/zulip_bots/zulip_bots/blogbot.py +++ b/zulip_bots/zulip_bots/blogbot.py @@ -124,7 +124,7 @@ def send_post(client, stream, topic, id, html): ) def save_post(save_dir, id, html): - hash = b64encode(sha256(html).digest(), b"-_").decode().rstrip("=") + hash = b64encode(sha256(html.encode()).digest(), b"-_").decode().rstrip("=") filename = f"{id}-{hash}.json" filepath = os.path.join(save_dir, filename) if os.path.exists(filepath):