This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ijmorlan
Recipients draghuram, gvanrossum, ijmorlan
Date 2007-12-21.18:25:14
SpamBayes Score 0.005440768
Marked as misclassified No
Message-id <1198261514.93.0.585980197542.issue1675@psf.upfronthosting.co.za>
In-reply-to
Content
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 will not work if errno is set to something other than EEXIST when
mkdir fails due to the directory already existing.  The above works on
my system but I can't be certain that all mkdir implementations report
EEXIST.

It should be safe to drop the errno check altogether, and I'm starting
to think that we should; at present it's really just an optimization to
avoid using .isdir, but only in what should be rather uncommon
circumstances.  I think the smell of "premature optimization" may be
hard to ignore.

So the if statement would be:

if excl or not path.isdir (name):
    raise
History
Date User Action Args
2007-12-21 18:25:15ijmorlansetspambayes_score: 0.00544077 -> 0.005440768
recipients: + ijmorlan, gvanrossum, draghuram
2007-12-21 18:25:14ijmorlansetspambayes_score: 0.00544077 -> 0.00544077
messageid: <1198261514.93.0.585980197542.issue1675@psf.upfronthosting.co.za>
2007-12-21 18:25:14ijmorlanlinkissue1675 messages
2007-12-21 18:25:14ijmorlancreate