MemoryError on reading mbox file

Christoph Krammer redtiger84 at googlemail.com
Thu Sep 13 04:08:11 EDT 2007


On 12 Sep., 16:39, Istvan Albert <istvan.alb... at gmail.com> wrote:
> This line reads an entire message into memory as a string. Is it
> possible that you have a huge email in there (hundreds of MB) with
> some attachment encoded as text?

No, the largest single message with the mbox is about 100KB large.


> For now I would recommend that you split your mbox file into several
> smaller ones. (I think all you need is to split at the To: fields) and
> run your script on these individual files.

I get it to work with splitting the mbox file into single files, one
for each message, with the git-mailsplit tool, that is included in the
gitk package. This solved the problem for now.

Thanks for all your help.

Christoph





More information about the Python-list mailing list