[issue1368247] unicode in email.MIMEText and email/Charset.py

Senthil Kumaran report at bugs.python.org
Wed Apr 28 09:29:10 CEST 2010


Senthil Kumaran <orsenthil at gmail.com> added the comment:

Hi David,
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.

----------
nosy: +orsenthil

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


More information about the Python-bugs-list mailing list