R. David Murray <rdmur...@bitdance.com> added the comment:

Well, we recently added support for parsing binary data streams to the email 
module (or added back, if you are looking at it from a python2 perspective), 
exactly because "in the wild" headers are not always RFC compliant ASCII, and 
because bodies often are RFC *compliant* 8bit.  So yes, the appropriate type 
for imaplib to be returning is bytes, and the application has to figure out how 
to decode it to string using the information contained internally in the email 
message.  The email package is the obvious way to do this, and if there are 
helper routines that an imaplib programmer would want in order to make that job 
easier, those would be very legitimate feature requests (but most of what one 
needs should already be there; specifically decode_header and friends, although 
there's an outstanding feature request for a convenience wrapper around that).

----------
nosy: +eric.smith

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

Reply via email to