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 neologix
Recipients amcnabb, hynek, neologix, r.david.murray
Date 2012-05-17.16:35:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAH_1eM0_0Fd+n8GEpB7CYb2__KDOBAmT86NSsXB5hZWEmXaM3g@mail.gmail.com>
In-reply-to <1337196103.57.0.353702019022.issue14702@psf.upfronthosting.co.za>
Content
> I guess this is the magic in mkdir -p:
>
> mkdir("expert", 0755)                   = -1 EACCES (Permission denied)
> chdir("expert")                         = 0
> mkdir("tmp", 0755)                      = -1 EEXIST (File exists)
>
> I'm not sure how I feel about that. I think we have more or less a policy in os & shutil not to change directories unless really necessary (like make_archive).

Calling chdir() should be avoided, as it is not thread safe.

Actually, the real problem is that stat() alone doesn't trigger
automount, to avoid mount storms e.g. when using find, see:
https://bugzilla.redhat.com/show_bug.cgi?id=497830
http://lkml.indiana.edu/hypermail/linux/kernel/1109.1/00100.html

Since calling chdir() is not an option, if we want to fix this, I
guess the way to go would be to open() the directory, and not use
path.exists().

But I find really uncomfortable with adding such a kludge, especially
since this problem is probably present in many different places
throughout the stdlib.

Furthermore, it seems that kernel from 2.6.38 do trigger automount
upon stat() (see
http://lkml.indiana.edu/hypermail/linux/kernel/1109.1/00210.html), so
I'd suggest to drop this as "won't fix".
History
Date User Action Args
2012-05-17 16:35:21neologixsetrecipients: + neologix, amcnabb, r.david.murray, hynek
2012-05-17 16:35:20neologixlinkissue14702 messages
2012-05-17 16:35:20neologixcreate