[issue36035] pathlib.Path().rglob() breaks with broken symlinks

Eryk Sun report at bugs.python.org
Wed Feb 20 23:01:04 EST 2019


Eryk Sun <eryksun at gmail.com> added the comment:

In Windows, the error for a path reparse (e.g. symlink or junction) that can't be resolved is ERROR_CANT_RESOLVE_FILENAME. Another common error is ERROR_INVALID_REPARSE_DATA. This can occur if the reparse data is malformed or if the target device is invalid for the reparse type. For example, a junction is restricted to [bind-]mounting local volumes, so it's invalid if it targets a remote device.

Windows errors to ignore should be added to _IGNORED_WINERRORS in Lib/pathlib.py. For example:

    _IGNORED_WINERRORS = (
        # ...
        1921, # ERROR_CANT_RESOLVE_FILENAME - similar to POSIX ELOOP
        4392, # ERROR_INVALID_REPARSE_DATA  - also for disallowed device targets
    )

----------
nosy: +eryksun

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


More information about the Python-bugs-list mailing list