Message291450
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' |
|
Date |
User |
Action |
Args |
2017-04-10 20:26:21 | jribbens | set | recipients:
+ jribbens, barry, r.david.murray |
2017-04-10 20:26:21 | jribbens | set | messageid: <1491855981.65.0.00197162829519.issue30032@psf.upfronthosting.co.za> |
2017-04-10 20:26:21 | jribbens | link | issue30032 messages |
2017-04-10 20:26:21 | jribbens | create | |
|