[New-bugs-announce] [issue1675] Race condition in os.makedirs

Isaac Morland report at bugs.python.org
Thu Dec 20 20:49:31 CET 2007


New submission from Isaac Morland:

There appears to be a race condition in os.makedirs.  Suppose two
processes simultaneously try to create two different directories with a
common non-existent ancestor.  For example process 1 tries to create
"a/b" and process 2 tries to create "a/c".  They both check that "a"
does not exist, then both invoke makedirs on "a".  One of these will
throw OSError (due to the underlying EEXIST system error), and this
exception will be propagated.  Note that this happens even though the
two processes are trying to create two different directories and so one
would not expect either to report a problem with the directory already
existing.

----------
messages: 58919
nosy: ijmorlan
severity: minor
status: open
title: Race condition in os.makedirs
type: behavior
versions: Python 2.5

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1675>
__________________________________


More information about the New-bugs-announce mailing list