You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
doc: recursive glob ** follows symlinks to directories
The existing note does already warn that "Using the ** pattern in large
directory trees may consume an inordinate amount of time", however
following symbolic links to directories brings that to entirely new
levels; learned the hard way.
I initially assumed this was a bug, tentatively fixed with a simple:
- if not dironly or entry.is_dir():
+ if not dironly or entry.is_dir(follow_symlinks=False):
... in glob.py#_iterdir(dirname, dironly):
Later I found https://bugs.python.org/issue13968 in the git log and saw
this is working as intended with even a symlink loop test.
0 commit comments