Message 110770 - Python tracker (original) (raw)

Since this is a library issue, it can go into 3.2. It is definitely a feature request, hence not in 2.7. Code that depends on the exception suppression would crash on an earlier release.

http://mail.python.org/pipermail/python-dev/2010-July/102027.html Guido said "Well, it really should have behaved like mkdir -p in the first place.", so this is accepted pending patch approval.

The patch includes doc, test, and code patches.

The name 'ensure_exist' for the new parameter strikes me as wrong, as well as too long for something that will nearly always be set to True. The function always ensures that the directory exists. The question is whether it is ok that it exist previously. I strongly suggest something shorter like 'exist_ok' as an alternative.

The name 'excl' used in #

The code looks OK as far as I can read it, but someone else should look at the C code for posimodule-mkdir.

Does the use of 'base = support.TESTFN' ensure that the test junk gets cleaned up?

This versus #1675: the presenting issues are different -- parent race condition leading to error versus leaf existence leading to error. However, the patches are nearly the same and would have much the same effect. The differences:

Thus there are three choices to make before committing.