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 calimeroteknik
Recipients barry, calimeroteknik, r.david.murray
Date 2017-10-22.00:48:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Eventually there is no bug, I was just confused at the output of print() on the EmailMessage.

I noticed that in email/ policy.utf8 was True.
The reason is found in email/ line 970 (class MIMEPart):

    def __str__(self):
       	return self.as_string(policy=self.policy.clone(utf8=True)

print() will use __str__() and this is why it happens.

I didn't dig out the exact reason since there are so many delegated calls.
In any case, the flattened message in smtplib.SMTP does contain what as_string() returns, which means that the policy.utf8 is only forced when using print().

Sorry for the false alert.
I can guess that the intention in forcing policy.utf8=True in __str__() was that SMTPUTF8 output is visually prettier than any ASCII-armored text.

After additional fuzzing, checking the output with EmailMessage.as_string(), everything seems OK.

That's a +1 for gh-3488, which fixes this bug.
Date User Action Args
2017-10-22 00:48:13calimerotekniksetrecipients: + calimeroteknik, barry, r.david.murray
2017-10-22 00:48:13calimerotekniksetmessageid: <>
2017-10-22 00:48:12calimerotekniklinkissue31831 messages
2017-10-22 00:48:11calimeroteknikcreate