From: Brian Curtin Date: Wed, 8 Jun 2011 23:43:57 +0000 (-0500) Subject: Fix #11583. Changed os.path.isdir to use GetFileAttributes instead of os.stat. X-Git-Tag: v3.3.0a1~2154 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a82eaade3cbfba9895b6121daf8ddb65b5aaa4d;p=python 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. --- 9a82eaade3cbfba9895b6121daf8ddb65b5aaa4d diff --cc Misc/NEWS index 1995b14158,15ed46f8e0..6f10ba6d3a --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -187,27 -22,9 +187,30 @@@ Core and Builtin Library ------- + - Issue #11583: Speed up os.path.isdir on Windows by using GetFileAttributes + instead of os.stat. + +- Issue #12021: Make mmap's read() method argument optional. Patch by Petri + Lehtinen. + +- Issue #9205: concurrent.futures.ProcessPoolExecutor now detects killed + children and raises BrokenProcessPool in such a situation. Previously it + would reliably freeze/deadlock. + +- Issue #12040: Expose a new attribute ``sentinel`` on instances of + :class:`multiprocessing.Process`. Also, fix Process.join() to not use + polling anymore, when given a timeout. + +- Issue #11893: Remove obsolete internal wrapper class ``SSLFakeFile`` in the + smtplib module. Patch by Catalin Iacob. + +- Issue #12080: Fix a Decimal.power() case that took an unreasonably long time + to compute. + +- Issue #12221: Remove __version__ attributes from pyexpat, pickle, tarfile, + pydoc, tkinter, and xml.parsers.expat. This were useless version constants + left over from the Mercurial transition + - Named tuples now work correctly with vars(). - Issue #12085: Fix an attribute error in subprocess.Popen destructor if the