Ah, I see: "When topdown is True, the caller can modify the dirnames list in-place (perhaps using del or slice assignment), and walk() will only recurse into the subdirectories whose names remain in dirnames". That's a little corner of the API I wasn't familiar with. Let me see what I can do...