Jon Ribbens added the comment: So on further investigation, with the new API and policy=SMTP, it does generate correct base64 output. So I guess on the basis that the new version can generate the right output, and it appears to be a deliberate choice that the default policy breaks the RFCs, you can close this issue ;-)
>>> from email.message import EmailMessage >>> from email.policy import SMTP >>> import base64 >>> msg = EmailMessage(policy=SMTP) >>> msg.set_content("hello\nthere", cte="base64") >>> msg.as_string() 'Content-Type: text/plain; charset="utf-8"\r\nContent-Transfer-Encoding: base64\r\nMIME-Version: 1.0\r\n\r\naGVsbG8NCnRoZXJlDQo=\r\n' >>> base64.b64decode("aGVsbG8NCnRoZXJlDQo=") b'hello\r\nthere\r\n' ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30032> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com