[issue33010] os.path.isdir() returns True for broken directory symlinks or junctions

Alexey Izbyshev report at bugs.python.org
Tue Mar 6 15:17:44 EST 2018


Alexey Izbyshev <izbyshev at ispras.ru> added the comment:

Thank you for the detailed response, Eryk!

> A mount point is always a directory, even if the volume isn't currently available.

Do I understand correctly that you propose to additionally change os.path.exists() to return True for mount points with unavailable volumes? Сurrently, os.path.exists() (i.e, the underlying os.stat()) attempts to traverse them, and this would be consistent with os.path.isdir() if the latter were changed to traverse directory reparse points too (both would return False for such mount points). Is your idea to change the behavior to match POSIX in a similar case when, for example, the remote NFS server is down but stat() still works on the local mount point? If so, is this a new idea compared to the first paragraph of [1] where you say that non-link reparse points should always be traversed?

[1] https://github.com/python/cpython/pull/5998#discussion_r172402233

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33010>
_______________________________________


More information about the Python-bugs-list mailing list