diff options
author | Charles Machalow <csm10495@gmail.com> | 2023-10-02 08:27:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-02 08:27:30 (GMT) |
commit | 29b875bb93099171aeb7a60cd18d4e1f4ea3c1db (patch) | |
tree | 4125892f44bd5a1a0a6dd733909ffcfcb9ec284a /Doc/library/shutil.rst | |
parent | 29c3a445d99f7e29086f6fdc4612e200cbbdc0ff (diff) | |
download | cpython-29b875bb93099171aeb7a60cd18d4e1f4ea3c1db.zip cpython-29b875bb93099171aeb7a60cd18d4e1f4ea3c1db.tar.gz cpython-29b875bb93099171aeb7a60cd18d4e1f4ea3c1db.tar.bz2 |
gh-109590: Update shutil.which on Windows to prefer a PATHEXT extension on executable files (GH-109995)
The default arguments for shutil.which() request an executable file, but extensionless files are not executable on Windows and should be ignored.
Diffstat (limited to 'Doc/library/shutil.rst')
-rw-r--r-- | Doc/library/shutil.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 4390a8e..d1949d6 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -476,6 +476,12 @@ Directory and files operations or ends with an extension that is in ``PATHEXT``; and filenames that have no extension can now be found. + .. versionchanged:: 3.12.1 + On Windows, if *mode* includes ``os.X_OK``, executables with an + extension in ``PATHEXT`` will be preferred over executables without a + matching extension. + This brings behavior closer to that of Python 3.11. + .. exception:: Error This exception collects exceptions that are raised during a multi-file |