[New-bugs-announce] [issue30706] EmailMessage Object Creation

Michael Salsone report at bugs.python.org
Mon Jun 19 17:19:46 EDT 2017


New submission from Michael Salsone:

I am looking to use the get_body() method from email.message.EmailMessage, but I am unable to create an object of this type. I am attempting to create an object of this from message_from_string (as well as some of the other email.parser methods). But it won't allow me to change the class to email.message.EmailMessage. I've read through the source for some this code, but I don't see where you thread the needle here, is it even possible?

Example:
from email.message import EmailMessage
email.message_from_string(self.original_message, _class=EmailMessage)

----------
components: email
messages: 296378
nosy: Michael Salsone, barry, r.david.murray
priority: normal
severity: normal
status: open
title: EmailMessage Object Creation
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30706>
_______________________________________


More information about the New-bugs-announce mailing list