[Spambayes] splitndirs bug [need help]

Richie Hindle richie@entrian.com
Fri, 04 Oct 2002 09:06:59 +0100


Hi Stephen,

> Splitndirs is incorreclt capturing and munging the "From " line of the 
> "next" message at the end of the preceding message. [...] This represents
> an overread of 114 bytes.

This is because mboxutils.py is opening the mailbox file in text mode, but
the Python mailbox library uses tell() and seek() to navigate around the
file, which is no good with text-mode files on Windows.

I've patched my mboxutils.py by changing the third-to-last line of
mboxutils.py from:

        fp = open(name)

to

        fp = open(name, "rb")

and that seemed to fix it.  I've been meaning to commit this, but I need
to work out whether reading the '\r\n' line endings will break anything
(Tim?)  In the meantime, that should fix your problem.

-- 
Richie Hindle
richie@entrian.com