Dmitry Shachnev <mity...@gmail.com> added the comment:

> In fact, there's really no reason to call an encode_ method at all, since if 
> you pass a string to MIMEText when giving it a non-ascii unicode string, it 
> will default to utf-8 and do the appropriate CTE encoding.

No, it doesn't:
Python 3.2.3rc1 (default, Mar  9 2012, 23:02:43) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from email.mime.text import MIMEText
>>> print(MIMEText('йцукен'))
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

йцукен
>>>

As you can see, it leaves russian text in unmodified state and sets the charset 
to "us-ascii". Should it be considered as a bug?

> What is your use case, by the way?
I'm writing a "send via e-mail" plugin for my ReText editor 
(http://retext.sourceforge.net/).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14360>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to