Message304643
On irc, bitmancer suggested that this problem is already solved by the
email.message.EmailMessage class, as it is:
In [119]: m = email.message.EmailMessage()
In [120]: m.set_content('abc', 'utf8', cte='base64')
In [121]: m.get_payload()
Out[121]: 'YWJjCg==\n'
In [122]: m.set_content('abc', 'utf8', cte='base64')
In [123]: m.get_payload()
Out[123]: 'YWJjCg==\n'
In [124]: m.get_payload(decode=True)
Out[124]: b'abc\n'
In [125]: print(m)
MIME-Version: 1.0
Content-Type: text/utf8; charset="utf-8"
Content-Transfer-Encoding: base64
YWJjCg==
Because this isn't a critical bug and `email.message.Message` is quite
deprecated, and this is solved by a newer API, this bug may not need
addressing. |
|
| Date |
User |
Action |
Args |
| 2017-10-19 21:55:03 | Zirak Ertan | set | recipients:
+ Zirak Ertan, barry, r.david.murray |
| 2017-10-19 21:55:03 | Zirak Ertan | set | messageid: <1508450103.29.0.213398074469.issue31820@psf.upfronthosting.co.za> |
| 2017-10-19 21:55:03 | Zirak Ertan | link | issue31820 messages |
| 2017-10-19 21:55:03 | Zirak Ertan | create | |
|