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

Thanks for the report and patch suggestion, but...

This is actually the way it is designed to work.  get_payload(i) returns the 
ith element of a multipart payload.  Your workaround is in fact the correct way 
to do this operation.  decode=True is documented to return None if is_multipart 
is True.

You will note that if decode=False, you get back the Message sub-object, not a 
string.  Since decoding a Message object (as opposed to its payload) is not a 
meaningful operation, None is returned for decode=True.  Arguably we should 
raise a TypeError or ValueError instead, but we don't for historical reasons.

----------
nosy: +r.david.murray
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

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

Reply via email to