From 9a3a1f2cb73ea71245e15292429f31db3f282bfc Mon Sep 17 00:00:00 2001 From: revsuine Date: Thu, 14 Nov 2024 18:46:30 +0000 Subject: [PATCH] encode the find and replaces for b64 decode --- gpgmymail | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gpgmymail b/gpgmymail index 1d23a23..c725fbf 100755 --- a/gpgmymail +++ b/gpgmymail @@ -82,8 +82,8 @@ def decode_email(message: email.message.Message) -> email.message.Message: for part in quopri_decoded_message.walk(): if not part.is_multipart(): if part.get("Content-Transfer-Encoding") == "base64": - b64_str = part.get_payload() - decoded_b64_str = part.get_payload(decode=True) + b64_str = part.get_payload().encode() + decoded_b64_str = part.get_payload(decode=True).encode() decoded_bytes = decoded_bytes.replace( b64_str, decoded_b64_str