[Python-Dev] os.walk() silently ignores errors

Mark Russell mrussell@verio.net
Tue, 13 May 2003 10:52:43 +0100


I've just noticed that os.walk() silently skips unreadable directories.  I 
think this is surprising behaviour, which at least should be documented (there 
is a comment explaining this is source, but nothing in the doc string).  Is it 
too late to add an optional callback argument to handle unreadable 
directories, so the caller could log them, raise an exception or whatever?  I 
think the default behaviour should still be to silently ignore them, but it 
would be nice to have a way to override it.

Mark Russell