[New-bugs-announce] [issue19037] mailbox module modifies maildir file times after moving from tmp directory

janzert report at bugs.python.org
Mon Sep 16 20:58:36 CEST 2013


New submission from janzert:

The Maildir.add and Maildir.__setitem__ methods in the mailbox module attempts to change the file mtime after moving the file into the new directory. This allows a race condition since other programs are can move or otherwise modify the file as soon as it is placed in the new directory. If the file is moved from the new directory before the mtime is set this results in an unexpected OSError exception.

The fix seems to simply be setting the file mtime before moving the file into its final position.

----------
components: Library (Lib)
messages: 197930
nosy: janzert, petri.lehtinen
priority: normal
severity: normal
status: open
title: mailbox module modifies maildir file times after moving from tmp directory
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4

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


More information about the New-bugs-announce mailing list