]> git.parisson.com Git - teleforma.git/commitdiff
Fixed encoding bug
authorGael Le Mignot <gael@pilotsystems.net>
Tue, 23 Jul 2024 10:03:14 +0000 (12:03 +0200)
committerGael Le Mignot <gael@pilotsystems.net>
Tue, 23 Jul 2024 10:03:14 +0000 (12:03 +0200)
teleforma/management/commands/teleforma-get-postman-replies.py

index 07f5daa15c241bd1fe05b92d45186a2fd355a420..af8e8a182b1ab39195b8aaaa55442610e61b0428 100644 (file)
@@ -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)