Author serhiy.storchaka
Recipients benhoyt, python-dev, scott.dial, serhiy.storchaka, vstinner
Date 2015-03-12.09:43:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426153402.66.0.354107816195.issue23605@psf.upfronthosting.co.za>
In-reply-to
Content
> Happy? :-)

No, it doesn't fix my example. :-(

I see following possibilities:

1. Partially revert the patch and always call path.islink(). I will not kill all the benefit of using os.scandir(), because there is a benefit from avoiding path.isdir() and in any case in large directories most content is usually files, not dirs.

2. Accept and document behavior change. This will break someone's code. :-(

3. Left os.walk as was (or only partially optimized as in 1), and add a new function with new behavior.

4. Add new boolean parameter that control behavior to os.walk().

5. Try to detect when dir list or filesystem were changed. Victor's patch does the first. For the second we can check if top directory inode and mtime were changed. But I afraid this wouldn't decrease a number of system calls.
History
Date User Action Args
2015-03-12 09:43:22serhiy.storchakasetrecipients: + serhiy.storchaka, scott.dial, vstinner, benhoyt, python-dev
2015-03-12 09:43:22serhiy.storchakasetmessageid: <1426153402.66.0.354107816195.issue23605@psf.upfronthosting.co.za>
2015-03-12 09:43:22serhiy.storchakalinkissue23605 messages
2015-03-12 09:43:22serhiy.storchakacreate