Steve Dower <steve.do...@python.org> added the comment:

Having spent more time than I'm proud of recursing through directories, I'd be 
happy enough with a convenience function that has sensible defaults.

If I want breadth-first recursion (and I often do), I'll write it myself. I 
have a slight preference for getting all files in a directory before going 
deeper (which is not what the PR does), and I think that's most consistent with 
the current behaviour.

I don't spend enough time dealing with symlinks to have strong opinions there, 
but given we have ways to resolve symlinks but not to get back to the original 
name (and I *have* had to deal with issues where I've needed to find the 
original name from the target :roll-eyes:) I'd say don't resolve anything 
eagerly.

If there's an easy and well-known algorithm for detecting infinite symlink 
recursion (e.g. resolve and check if it's a parent of itself) then do that and 
skip it, but don't return the targets.

----------
nosy: +steve.dower

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36602>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to