Issue #27445: Don't pass str(_charset) to MIMEText.set_payload()
Patch by Claude Paroz.
diff --git a/Lib/email/mime/text.py b/Lib/email/mime/text.py
index 479928e..da03086 100644
--- a/Lib/email/mime/text.py
+++ b/Lib/email/mime/text.py
@@ -35,10 +35,8 @@
_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)