[issue26781] os.walk max_depth

Aviv Palivoda report at bugs.python.org
Wed Apr 20 16:35:03 EDT 2016


Aviv Palivoda added the comment:

I am not sure about the wide use of this feature but I do think this is a nice feature to add to os.walk. I can see how you can implement is_too_deep by counting the number of separators in the path. However I don't think it is trivial to do that. In addition doing the same when topdown is False will not work.
As for the other limitations you suggested I think they are less trivial then limiting the recursion depth.

As for the "symlink infinite loop" I agree that it will be better to do that by tracking the paths we have already visited but avoiding infinite loop is just a bonus that you get from this feature.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26781>
_______________________________________


More information about the Python-bugs-list mailing list