[Python-Dev] My summary of the scandir (PEP 471)

Ben Hoyt benhoyt at gmail.com
Tue Jul 1 17:42:25 CEST 2014


> We need per-iteration error handling for the readdir call anyway, so I think
> an onerror callback is a better option than dropping the ability to easily
> obtain full stat information as part of the iteration.

I don't mind the idea of an "onerror" callback, but it's adding
complexity. Putting aside the question of caching/timing for a second
and assuming .lstat() as per the current PEP 471, do we really need
per-iteration error handling for readdir()? When would that actually
fail in practice?

-Ben


More information about the Python-Dev mailing list