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.

Author Zirak Ertan
Recipients Zirak Ertan, barry, r.david.murray
Date 2017-10-19.21:55:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1508450103.29.0.213398074469.issue31820@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-10-19 21:55:03Zirak Ertansetrecipients: + Zirak Ertan, barry, r.david.murray
2017-10-19 21:55:03Zirak Ertansetmessageid: <1508450103.29.0.213398074469.issue31820@psf.upfronthosting.co.za>
2017-10-19 21:55:03Zirak Ertanlinkissue31820 messages
2017-10-19 21:55:03Zirak Ertancreate