[issue11583] os.path.isdir() is slow on windows

Brian Curtin report at bugs.python.org
Fri Jun 3 22:55:52 CEST 2011


Brian Curtin <brian at python.org> added the comment:

Here's a patch that works. All tests are passing.

I changed from using FindFirstFile to GetFileAttributes, which provides basically the same performance characteristics.

One change in this implementation is to not raise a WindowsError when the file cannot be opened. The original os.stat would return False in that case, so now this function returns False (before it just passed on the WindowsError, which killed lots of tests).

----------
Added file: http://bugs.python.org/file22239/issue11583_v2.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11583>
_______________________________________


More information about the Python-bugs-list mailing list