From: Gael Le Mignot Date: Tue, 23 Jul 2024 10:03:14 +0000 (+0200) Subject: Fixed encoding bug X-Git-Tag: 2.9.2~66 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=2577581eefe47d4d1261c7a2761e256a5a467576;p=teleforma.git Fixed encoding bug --- diff --git a/teleforma/management/commands/teleforma-get-postman-replies.py b/teleforma/management/commands/teleforma-get-postman-replies.py index 07f5daa1..af8e8a18 100644 --- a/teleforma/management/commands/teleforma-get-postman-replies.py +++ b/teleforma/management/commands/teleforma-get-postman-replies.py @@ -18,10 +18,12 @@ import poplib def decode_header(header, charset): """ Decode a header field - """ + """ header = email.header.decode_header(header) res = [] for value, encoding in header: + if isinstance(value, bytes): + value = value.decode(encoding) res.append(value) return " ".join(res)