Unsafe Pickle Saving

David Abrahams <dave-UB3wUj7V41K5azolltMz9laTQe2KTcn/@public.gmane.org> Sun, 21 Oct 2007 10:37:08 -0400
Newsgroups gmane.mail.spam.spambayes.devel
Message-ID <[email protected]>
SpamBayes has, in storage.py, some code for storing pickles safely,
but that code is only used for the training database and not the
numerous other pickles used in SpamBayes, e.g. for caches.  The result
was that, when I was doing server-side filtering, cache pickles would
be read while being written, and SpamBayes wasn't prepared to deal
with the corruption.

I submitted a patch at
http://sourceforge.net/tracker/index.php?func=detail&aid=1816240&group_id=61702&atid=498103
that factors that code out and uses it wherever pickles are saved.

Frankly it would be worth looking at all the places where SpamBayes
saves files, because this is probably not a pickle-specific issue.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com