[issue11116] mailbox and email errors

Steffen Daode Nurpmeso report at bugs.python.org
Sat Feb 5 13:09:42 CET 2011

Steffen Daode Nurpmeso <sdaoden at googlemail.com> added the comment:

Well, here is the long-asked-for 'fp_mailbox.py' test thing.
Note: it generates a 'test.mbox' in CWD!

    print("USAGE: fp_mailbox.py 0|1|2",
          "       0 = use raw UTF-8 string",
          "       1 = use UTF-8 string",
          "       2 = use escaped byte string", sep="\n")

It does not use FeedParser directly, but email.message_from_*.  It's simple minded, but a dumb new python(1) user (like me) does not know otherwise, i guess.  Of course the input is malformed, but, you know, shit happens (you may trust me in respect to that).  I want to point out that .defects is the empty list, even though the input is *not* correctly converted (quopri/base64) and blows mailbox.add later on for test cases 0 and 1 (resulting in corrupted mailbox files).  2 does not cause a traceback and is mailbox.add()ed, but the resulting mail is not standart-conforming either.  For me and my (S-)Postman all of this means that i have to encapsulate all of this with a 'MessageBuilder' layer on top of the python(1) builtin email package.

  I personally will encapsulate the email.* stuff with a MessageBuilder

Added file: http://bugs.python.org/file20683/fp_mailbox.py

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list