[Python-Dev] Testers wanted: mailbox.py bugfix

A.M. Kuchling amk at amk.ca
Thu Jan 18 14:07:02 CET 2007


On Wed, Jan 17, 2007 at 03:36:58PM -0600, Charles Cazabon wrote:
> I can't speak for MMDF or Babyl, but it's a well-known requirement that all
> programs on a system must use the same type of locking when mbox files are
> used; the administrator picks his favourite (fcntl, dotlocking, whatever) and
> then has to ensure all mbox-aware programs are compiled to use that locking
> style.

That's not actually the bug,  The problem is that code that does:

    <open mailbox>
    <read mailbox>
    ... wait around a bit ...
    <lock mailbox>
    <modify mailbox>
    <unlock mailbox>

can corrupt the mailbox if something else comes in and modifies the
mailbox during the "wait around a bit" phase.  This happens because an
table of contents is generated when the mailbox is read and then never
updated, missing changes made by other processes after the ToC is
read.

--amk


More information about the Python-Dev mailing list