This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: EmailMessage utf-8 folding error
Type: behavior Stage:
Components: email Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: andrzejQ, barry, r.david.murray
Priority: normal Keywords:

Created on 2021-10-21 11:18 by andrzejQ, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
ERROR_folding_in_EmailMessage.py andrzejQ, 2021-10-21 11:18 Missing white space after folding on ','
Messages (2)
msg404583 - (view) Author: Andrzej Kubaszek (andrzejQ) * Date: 2021-10-21 11:18
email.message - EmailMessage Error
Missing white space after folding on ','

msg['To'] = 'Ab Ć<abc@def.com>,Ab Ć<abc@def.com>,Ab Ć<abc@def.com>,Ab Ć<abc@def.com>'

print(msg.as_string())
'''
To: Ab =?utf-8?q?=C4=86?=<abc@def.com>,Ab =?utf-8?q?=C4=86?=<abc@def.com>,
Ab =?utf-8?q?=C4=86?=<abc@def.com>,Ab =?utf-8?q?=C4=86?=<abc@def.com>
Subject: EmailMessage Error. Missing white space after folding on ",".
 https://www.ietf.org/rfc/rfc2822.txt , 2.2.3. Long Header Fields
'''
msg404770 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2021-10-22 13:58
I'm pretty sure this is a duplicate report and that we worked on a fix, but I don't know if it got committed because I can't find the issue...

(To be clear, the problem here is the lack of whitespace at the start of the folded part of the header.)
History
Date User Action Args
2022-04-11 14:59:51adminsetgithub: 89714
2021-10-22 13:58:56r.david.murraysetmessages: + msg404770
2021-10-21 11:18:06andrzejQcreate