Message160979
> 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". |
|
Date |
User |
Action |
Args |
2012-05-17 16:35:21 | neologix | set | recipients:
+ neologix, amcnabb, r.david.murray, hynek |
2012-05-17 16:35:20 | neologix | link | issue14702 messages |
2012-05-17 16:35:20 | neologix | create | |
|