[issue4661] email.parser: impossible to read messages encoded in a different encoding

R. David Murray report at bugs.python.org
Fri Oct 8 13:56:36 CEST 2010


R. David Murray <rdmurray at bitdance.com> added the comment:

Generator converts 8bit bodies into 7bit bodies by applying an appropriate 7bit CTE.  The reason it does this is that the output of Generator will often be passed to some other Python library function (most often smtplib) that can only handle ASCII unicode input.  That is, Generator now produces a 7bit clean message that can be put on the wire by encoding it to ascii.  This means that RFC-compliant bytes input can be successfully transmitted onward using Generator and smtplib, whereas if Generator produced non-ASCII unicode it would not be possible to pass a message with an 8bit CTE on to smtplib.

The statement about string input and output is a description of email *5.0*, the existing email package in 3.0 and 3.1, before my patch.  The differences between 4.0 and 5.0 were never previously added to the docs, so I had to add them in order to then describe the differences between 5.0 and 5.1.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4661>
_______________________________________


More information about the Python-bugs-list mailing list