summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2011-06-08 23:17:18 (GMT)
committerBrian Curtin <brian@python.org>2011-06-08 23:17:18 (GMT)
commit9c669ccc77c85eac245d460bab510a38b20d9a08 (patch)
tree067c0f49c9e1fd369765a12003b3f8bc502c7175 /Misc
parent41c1910bb3229874a02c19ecd9189715b3ce501b (diff)
downloadcpython-9c669ccc77c85eac245d460bab510a38b20d9a08.zip
cpython-9c669ccc77c85eac245d460bab510a38b20d9a08.tar.gz
cpython-9c669ccc77c85eac245d460bab510a38b20d9a08.tar.bz2
Fix #11583. Changed os.path.isdir to use GetFileAttributes instead of os.stat.
By changing to the Windows GetFileAttributes API in nt._isdir we can figure out if the path is a directory without opening the file via os.stat. This has the minor benefit of speeding up os.path.isdir by at least 2x for regular files and 10-15x improvements were seen on symbolic links (which opened the file multiple times during os.stat). Since os.path.isdir is used in several places on interpreter startup, we get a minor speedup in startup time.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS3
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 16a0f29..15ed46f 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -22,6 +22,9 @@ Core and Builtins
Library
-------
+- Issue #11583: Speed up os.path.isdir on Windows by using GetFileAttributes
+ instead of os.stat.
+
- Named tuples now work correctly with vars().
- Issue #12085: Fix an attribute error in subprocess.Popen destructor if the