mailbox module broken!

holger krekel pyth at devel.trillke.net
Thu Oct 3 20:06:28 CEST 2002


Stuart D. Gathman wrote:
> The following trivial code to read through a unix mailbox skips a little
> over 100 messages in the mailbox at 
> 
> http://www.bmsi.com/python/test/inbox
> 
> I have tested python-2.1.3 and python2-2.2.1
> 
> import mailbox
> 
> f = open('inbox','r')
> mbox = mailbox.UnixMailbox(f)

If you use mailbox.PortableUnixMailbox instead it should work.  Refer
to the source (mailbox.py) in your python installation for why
this is so.  

I often find it surprisingly easy to just look at the source
code of a module (as long as it is in python) to find out what happens.

regards,

    holger




More information about the Python-list mailing list