email module Bug in 2.2
Sheila King
usenet at thinkspot.net
Sat Feb 9 01:17:59 EST 2002
On 9 Feb 2002 05:58:53 GMT, quinn at vomit.ugcs.caltech.edu (Quinn Dunkan)
wrote in comp.lang.python in article
<slrna69eks.c6s.quinn at vomit.ugcs.caltech.edu>:
> From the libref:
> is_multipart()
> Return 1 if the message's payload is a list of sub-Message objects, otherwise
> return 0. When is_multipart() returns 0, the payload should either be a string
> object, or a single Message instance.
>
> So notice that is_multipart() does not check if get_main_type() is 'multipart'.
> I don't know much about the MIME hairball, but the msg appears to claim it is
> multipart, but doesn't actually have multiple parts. Message.add_payload only
> sets the payload to a list if it's called more than once, not if the msg calls
> itself 'multipart'. I'm not sure if this is correct or not, though I'm
> inclined to agree with you that it's not (section 12.2.2.2 implies that you
> should only get a non-string, non-list payload for some message/* types), but
> is_multipart() is behaving strictly according to documentation.
OK, thanks for pointing this out. I'm sure I read that documentation
before, but right now I'm so steeped in documentation (learning the new
email module...which in general I think is fantastic, and the re module
while working with RFCs and other people on a project...I'm a bit
overwhelmend).
...<useful code sample snipped>...
I'm going to have to restrain myself a bit more from tossing the word
"bug" around in the subject headings. I hope people don't take offense
too quickly.
Thanks,
--
Sheila King
http://www.thinkspot.net/sheila/
"When introducing your puppy to an adult cat,
restrain the puppy, not the cat." -- Gwen Bailey,
_The Perfect Puppy: How to Raise a Well-behaved Dog_
More information about the Python-list
mailing list