[Python-Dev] Updates to PEP 471, the os.scandir() proposal

Ethan Furman ethan at stoneleaf.us
Wed Jul 9 16:41:11 CEST 2014

On 07/09/2014 06:41 AM, Ethan Furman wrote:
> Leave it up to the onerror handler.  If it returns None, skip yielding the entry, otherwise yield whatever it returned
> -- which also means the error handler should be able to set fields on the DirEntry:
>    def log_err(exc, entry):
>        logger.warn("Cannot stat {}".format(exc.filename))
>        entry.lstat.st_size = 0
>        return True

Blah.  Okay, either return the DirEntry (possibly modified), or have the log_err return entry instead of True.  (Now 
where is that caffeine??)


More information about the Python-Dev mailing list