[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: Looks like that Windows buildbot is now green. Of the stable bots only OpenIndiana is red, and it's unrelated. -- ___ Python tracker

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: Oops, sorry about that. I will see if I can figure out how to repro this -- on my own Mac it succeeds. In the mean time if you could have a look yourself (since you can repro it on your own computer) I'd be grateful. Initial hunches: maybe a

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4043e08e6e52 by Guido van Rossum in branch '3.4': Add another try/except PermissionError to avoid depending on listdir order. Fix issues #24120 and #26012. https://hg.python.org/cpython/rev/4043e08e6e52 New changeset 8a3b0c1fb3d3 by Guido van

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: Should be fixed for real now. -- status: open -> closed ___ Python tracker ___

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Martin Panter
Martin Panter added the comment: Thanks, your latest change seems to have fixed it on my Linux computer, and most of the buildbots. However now there is a failure on :

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-07 Thread Guido van Rossum
Guido van Rossum added the comment: I think I understand the Windows failure. I uncommented some tests that were previously broken due to the symlink loop and/or PermissionError, but one of these has a different expected outcome if symlinks don't work. I've pushed a hopeful fix for that (no

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 18f5b125a863 by Guido van Rossum in branch '3.4': Issue #26012: Don't traverse into symlinks for ** pattern in pathlib.Path.[r]glob(). https://hg.python.org/cpython/rev/18f5b125a863 New changeset 9826dbad1252 by Guido van Rossum in branch '3.5':

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-06 Thread Guido van Rossum
Changes by Guido van Rossum : -- resolution: -> fixed stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-06 Thread Guido van Rossum
Guido van Rossum added the comment: I'm going to fix this by skipping all symlinks in _RecursiveWildcardSelector. -- assignee: -> gvanrossum ___ Python tracker

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-04 Thread Ned Deily
Changes by Ned Deily : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-04 Thread Guido van Rossum
Changes by Guido van Rossum : -- components: +Library (Lib) ___ Python tracker ___ ___

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-04 Thread Guido van Rossum
New submission from Guido van Rossum: I created a symlink loop as follows: mkdir tmp cd tmp ln -s ../tmp baz cd .. Then I tried to list it recursively using rglob(): >>> list(pathlib.Path('tmp').rglob('**/*') This caused an infinite regress: Traceback (most recent call last): File "", line

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-04 Thread Josh Rosenberg
Josh Rosenberg added the comment: So would the goal of a fix be something like dev/inode memoization to prevent traversing the same link twice? To provide an argument to prevent following symlinks at all (as in stuff like os.walk), possibly defaulting to followlinks=False? It looks like

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-04 Thread Guido van Rossum
Guido van Rossum added the comment: I agree it's easiest just not to traverse symlinks matching **. glob.py avoids the errors (but not the senseless recursion) by simply ignoring OSError coming out of listdir(). That might be a good idea anyways (it might even be a simpler way to avoid the

[issue26012] pathlib.Path().rglob() is fooled by symlink loops

2016-01-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: glob.glob() just stops too deep recursion. >>> import glob >>> glob.glob('tmp/**/*') ['tmp/baz/baz'] >>> glob.glob('tmp/**/*', recursive=True) ['tmp/baz', 'tmp/baz/baz', 'tmp/baz/baz/baz', 'tmp/baz/baz/baz/baz', 'tmp/baz/baz/baz/baz/baz',