diff -r 59a189a15933 Doc/library/email.mime.rst --- a/Doc/library/email.mime.rst Thu Oct 25 17:23:54 2012 -0700 +++ b/Doc/library/email.mime.rst Fri Oct 26 14:16:43 2012 +0200 @@ -186,4 +186,8 @@ set of the text and is passed as a parameter to the :class:`~email.mime.nonmultipart.MIMENonMultipart` constructor; it defaults to ``us-ascii`` if the string contains only ``ascii`` codepoints, and - ``utf-8`` otherwise. + ``utf-8`` otherwise. The *_charset* parameter accepts either a string or a + :class:`~email.charset.Charset` instance. + + .. versionadded:: 3.4 + *_charset* also accepts :class:`~email.charset.Charset` instances. diff -r 59a189a15933 Lib/email/mime/text.py --- a/Lib/email/mime/text.py Thu Oct 25 17:23:54 2012 -0700 +++ b/Lib/email/mime/text.py Fri Oct 26 14:16:43 2012 +0200 @@ -37,6 +37,6 @@ _charset = 'utf-8' MIMENonMultipart.__init__(self, 'text', _subtype, - **{'charset': _charset}) + **{'charset': str(_charset)}) self.set_payload(_text, _charset) diff -r 59a189a15933 Lib/test/test_email/test_email.py --- a/Lib/test/test_email/test_email.py Thu Oct 25 17:23:54 2012 -0700 +++ b/Lib/test/test_email/test_email.py Fri Oct 26 14:16:43 2012 +0200 @@ -1445,6 +1445,10 @@ msg = MIMEText('hello there', _charset='us-ascii') 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')) + eq(msg.get_charset().input_charset, 'utf-8') + eq(msg['content-type'], 'text/plain; charset="utf-8"') def test_7bit_input(self): eq = self.assertEqual diff -r 59a189a15933 Misc/ACKS --- a/Misc/ACKS Thu Oct 25 17:23:54 2012 -0700 +++ b/Misc/ACKS Fri Oct 26 14:16:43 2012 +0200 @@ -881,6 +881,7 @@ Alexandre Parenteau Dan Parisien William Park +Claude Paroz Harri Pasanen Gaƫl Pasgrimaud Bo Peng