[issue1368247] unicode in email.MIMEText and email/Charset.py
report at bugs.python.org
Wed Apr 28 09:29:10 CEST 2010
Senthil Kumaran <orsenthil at gmail.com> added the comment:
The attached patch for this issue:
+ if isinstance(payload, unicode):
+ payload = payload.encode(msg.get_charset().output_charset or 'us-ascii')
looks fine enough to me. Are you worried about the /or 'us-ascii'/ part of this patch?
IMHO, the patch may prevent the straight forward Exception for which the issue was raised.
But on a larger scale, it is advisable to document MIMEText usage wth encoding as you mentioned.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list