diff -r b0087e17cd5e Lib/email/mime/text.py --- a/Lib/email/mime/text.py Fri Jul 01 17:57:30 2016 +0300 +++ b/Lib/email/mime/text.py Sat Jul 02 23:24:17 2016 +0200 @@ -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) diff -r b0087e17cd5e Lib/test/test_email/test_email.py --- a/Lib/test/test_email/test_email.py Fri Jul 01 17:57:30 2016 +0300 +++ b/Lib/test/test_email/test_email.py Sat Jul 02 23:24:17 2016 +0200 @@ -1652,9 +1652,12 @@ eq(msg.get_charset().input_charset, 'us-ascii') eq(msg['content-type'], 'text/plain; charset="us-ascii"') # Also accept a Charset instance - msg = MIMEText('hello there', _charset=Charset('utf-8')) + charset = Charset('utf-8') + charset.body_encoding = None + msg = MIMEText('hello there', _charset=charset) eq(msg.get_charset().input_charset, 'utf-8') eq(msg['content-type'], 'text/plain; charset="utf-8"') + eq(msg.get_payload(), 'hello there') def test_7bit_input(self): eq = self.assertEqual