gh-76511: Fix email.Message.as_string() for non-ASCII message with ASCII charset (GH-116125)

This commit is contained in:
Serhiy Storchaka 2024-03-05 17:49:01 +02:00 committed by GitHub
parent df59401108
commit f97f25ef5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 2 deletions

View file

@ -243,7 +243,7 @@ class Generator:
# existing message.
msg = deepcopy(msg)
del msg['content-transfer-encoding']
msg.set_payload(payload, charset)
msg.set_payload(msg._payload, charset)
payload = msg.get_payload()
self._munge_cte = (msg['content-transfer-encoding'],
msg['content-type'])