MaildirMessage
Ben Finney
bignose+hates-spam at benfinney.id.au
Fri Jul 13 02:26:59 EDT 2007
"Gabriel Genellina" <gagsl-py2 at yahoo.com.ar> writes:
> msg is an instance of MaildirMessage (subclass of Message) - it has
> no specific iterator, so "for m in msg" tries to use the sequence
> protocol, starting at 0; that is, tries to get msg[0]. Message
> objects support the mapping protocol, and msg[0] tries to find a
> *header* 0, converting the name 0 to lowercase, and fails miserably.
Which is a bug in the 'email.message' module, in my view. If it's
attempting to support a mapping protocol, it should allow iteration
the same way standard Python mappings do: by iterating over the keys.
--
\ "If you continue running Windows, your system may become |
`\ unstable." -- Microsoft, Windows 95 BSOD message |
_o__) |
Ben Finney
More information about the Python-list
mailing list