Charles-François Natali <neolo...@free.fr> added the comment: > 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". ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14702> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com