IMAP4 example in docs causes memory error for me (OS X 10.3,

Tony Meyer t-meyer at ihug.co.nz
Mon Nov 15 05:38:30 CET 2004


[Problems with IMAP4, OS X 10.3 and FETCH]

> seems like i have a slight work around to this issue, which is to use 
> try and except and to also reinit the imap instance every 
> time you want to get a message... this limits the error to only larger 
> messages. but it's still weird.

Some SpamBayes users reported this problem (using the SpamBayes IMAP filter)
a while back.  Googling about, it appeared that Apple made some changes with
10.3 so that malloc doesn't like giving out large chunks of memory (none of
the problems were specifically with Python).  I don't have a Mac to test
whether that's the case, though.

It does seem that the best solution would be to wrap the code to catch
MemoryErrors, and if they occur, try getting the message in chunks.  Not a
simple solution, though.

If you do find more information, please post it here, as I (and maybe
others) would be interested.  FWIW, SpamBayes just skips any messages that
cause this problem, which is a solution, but not a great one.

=Tony.Meyer




More information about the Python-list mailing list