[New-bugs-announce] [issue7360] [mailbox] race: mbox may lose data with concurrent access

Matthias Klose report at bugs.python.org
Thu Nov 19 17:20:22 CET 2009


New submission from Matthias Klose <doko at debian.org>:

[forwarded from http://bugs.debian.org/451733]

the mailbox._singlefileMailbox class is not safe with concurrent access,
because mailbox._singlefileMailbox.flush() replaces the underlying file
with a new copy by constructing a temporary file and then renaming it.
This breaks all other class instances which have this mailbox open.  I'm
attaching a script demonstrating the problem. 

I think it's a bad idea to use rename(2) here; overwriting the file
content would fix the race condition, and #451274 too[1].

----------
components: Library (Lib)
messages: 95487
nosy: doko
severity: normal
status: open
title: [mailbox] race: mbox may lose data with concurrent access
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7360>
_______________________________________


More information about the New-bugs-announce mailing list