mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
Update message.py
use `email.message_from_bytes()` instead of decoding the bytes to then call `message_from_string`
This commit is contained in:
committed by
holger krekel
parent
5f1e5ef206
commit
369bb9166e
@@ -162,7 +162,7 @@ class Message(object):
|
|||||||
if mime_headers:
|
if mime_headers:
|
||||||
s = ffi.string(ffi.gc(mime_headers, lib.dc_str_unref))
|
s = ffi.string(ffi.gc(mime_headers, lib.dc_str_unref))
|
||||||
if isinstance(s, bytes):
|
if isinstance(s, bytes):
|
||||||
s = s.decode("ascii")
|
return email.message_from_bytes(s)
|
||||||
return email.message_from_string(s)
|
return email.message_from_string(s)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
Reference in New Issue
Block a user