From 369bb9166eb01da9a17495332f3dfbfd33419747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asiel=20D=C3=ADaz=20Ben=C3=ADtez?= Date: Sat, 30 Nov 2019 23:21:40 -0500 Subject: [PATCH] Update message.py use `email.message_from_bytes()` instead of decoding the bytes to then call `message_from_string` --- python/src/deltachat/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/deltachat/message.py b/python/src/deltachat/message.py index 1cec5cb5d..acb1a44a0 100644 --- a/python/src/deltachat/message.py +++ b/python/src/deltachat/message.py @@ -162,7 +162,7 @@ class Message(object): if mime_headers: s = ffi.string(ffi.gc(mime_headers, lib.dc_str_unref)) if isinstance(s, bytes): - s = s.decode("ascii") + return email.message_from_bytes(s) return email.message_from_string(s) @property