[issue1675] Race condition in os.makedirs

2010-07-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: Isaac, thank you for the report and patch. With more attention, this might have been tweaked and applied a couple of years ago. We are trying to get better at timely responses. -- ___ Python tracker

[issue1675] Race condition in os.makedirs

2010-07-20 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- resolution: -> duplicate status: open -> closed superseder: -> os.mkdir() and os.makedirs() add a keyword argument to suppress "File exists" exception. ___ Python tracker __

[issue1675] Race condition in os.makedirs

2010-07-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: The precipitating issue for this and #9299 are different: parent race leading to error versus tail existence leading to error. However, both patches address both issues. See #9299 for my comparison of this patch and that. I am consolidating nosy lists there.

[issue1675] Race condition in os.makedirs

2010-07-19 Thread Isaac Morland
Isaac Morland added the comment: This is again being discussed in Issue 9299. -- ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue1675] Race condition in os.makedirs

2008-11-11 Thread Zooko O'Whielacronx
Zooko O'Whielacronx <[EMAIL PROTECTED]> added the comment: Here's the version of this that I've been using for almost a decade now: http://allmydata.org/trac/pyutil/browser/pyutil/pyutil/fileutil.py?rev=127#L241 Actually I used to have a bigger version that could optionally require certain thin

[issue1675] Race condition in os.makedirs

2008-01-20 Thread Gabriel Genellina
Changes by Gabriel Genellina: -- nosy: +gagenellina __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue1675] Race condition in os.makedirs

2008-01-11 Thread Christian Heimes
Changes by Christian Heimes: -- components: +Library (Lib) keywords: +easy versions: +Python 2.6 -Python 2.5 __ Tracker <[EMAIL PROTECTED]> __ _

[issue1675] Race condition in os.makedirs

2007-12-21 Thread Isaac Morland
Isaac Morland added the comment: I should add that the new parameter is called "excl" by analogy with the O_EXCL option to os.open(). Also, I'm not absolutely certain about the test for which exceptions should be ignored when excl == False: e.errno == errno.EEXIST and path.isdir (name) This wi

[issue1675] Race condition in os.makedirs

2007-12-21 Thread Isaac Morland
Isaac Morland added the comment: Attached is an svn diff against the trunk. I was looking at os.py from Python 2.5 not the trunk, and it appears that an attempt at fixing the race condition has already been put into os.py, but I don't believe it's correct. The attached patch renames the existin

[issue1675] Race condition in os.makedirs

2007-12-20 Thread Isaac Morland
Isaac Morland added the comment: Yes, I'm really combining two things here - the race condition, which I argue is a (minor) bug, and a feature request to be able to "ensure exists" a directory. I have not produced a proper Python patch before and I have other things to do so this will take longe

[issue1675] Race condition in os.makedirs

2007-12-20 Thread Guido van Rossum
Guido van Rossum added the comment: Can you rephrase this as svn diff output? Also, mkdir() is a confusing name for the helper -- I'd call it forgiving_mkdir() or something like that. __ Tracker <[EMAIL PROTECTED]> _

[issue1675] Race condition in os.makedirs

2007-12-20 Thread Isaac Morland
Changes by Isaac Morland: Added file: http://bugs.python.org/file9016/makedirs.py __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list U

[issue1675] Race condition in os.makedirs

2007-12-20 Thread Guido van Rossum
Guido van Rossum added the comment: I think we can fix this as follows: whenever it calls os.mkdir() and an error is returned, check if that is EISDIR or EEXISTS, and if so, check that indeed it now exists as a directory, and then ignore the error. Moreover, I'd like to do this for the ultimate

[issue1675] Race condition in os.makedirs

2007-12-20 Thread Isaac Morland
Isaac Morland added the comment: The only thing I found in the bug database concerning os.makedirs was Issue 766910 (http://bugs.python.org/issue766910). I realized os.makedirs had a race condition because in my application I want to create directories but it's perfectly fine if they already exi

[issue1675] Race condition in os.makedirs

2007-12-20 Thread Raghuram Devarakonda
Raghuram Devarakonda added the comment: I don't think os.makedirs() can do anything here. It should be caller's responsibility to check for this kind of issues. -- nosy: +draghuram __ Tracker <[EMAIL PROTECTED]>

[issue1675] Race condition in os.makedirs

2007-12-20 Thread Isaac Morland
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 c