Issue #27445: Don't pass str(_charset) to MIMEText.set_payload()

Patch by Claude Paroz.
This commit is contained in:
Berker Peksag 2016-09-08 19:40:30 +03:00
parent 82733fac8d
commit 2b2a9be913
3 changed files with 8 additions and 4 deletions

View file

@ -35,10 +35,8 @@ class MIMEText(MIMENonMultipart):
_charset = 'us-ascii'
except UnicodeEncodeError:
_charset = 'utf-8'
if isinstance(_charset, Charset):
_charset = str(_charset)
MIMENonMultipart.__init__(self, 'text', _subtype,
**{'charset': _charset})
**{'charset': str(_charset)})
self.set_payload(_text, _charset)