Re: walk() in module posixpath
Sat, 18 Jun 1994 11:24:21 +0200


> The walk() function in module posixpath will walk through symlinks to
> directories. This causes big problems with circular links. Is this the
> intended behaviour?

> i.e. I think the intent is (and should be) to hand you the complete
> list and have your 'visit' function do any filtering. Changing walk
> to do this prefiltering would break applications that want to search
> down symbolic links. ( Even if there *are* circular references, the
> search may end by some other criteria. )

Actually, I think Neil is right. The walk() function should work
correctly for a trivial visit function.

Anyway, this is really old code -- if I were to do it all over again I
probably would've put this function in its own module (since it can
easily be made independent of posix) and made its interface more
sensible (especially the passing in of 'arg' to the function seems
weird for current Python, as seems the idea of the visit function
modifying its list argument to implement a filter...

--Guido van Rossum, CWI, Amsterdam <>
URL: <>