]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-127001: Fix PATHEXT issues in shutil.which() on Windows (GH-127035) (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 22 Nov 2024 16:18:44 +0000 (17:18 +0100)
committerGitHub <noreply@github.com>
Fri, 22 Nov 2024 16:18:44 +0000 (16:18 +0000)
commit7f22b87d3573635699e71680b2a1596fef9cac4d
treebb45a3410084d58f2616a71678f329275ba9e41c
parent5468d219df65d4fe3335e2bcc09d2f6032a32c70
[3.13] gh-127001: Fix PATHEXT issues in shutil.which() on Windows (GH-127035) (GH-127156)

* Name without a PATHEXT extension is only searched if the mode does not
  include X_OK.
* Support multi-component PATHEXT extensions (e.g. ".foo.bar").
* Support files without extensions in PATHEXT contains dot-only extension
  (".", "..", etc).
* Support PATHEXT extensions that end with a dot (e.g. ".foo.").
(cherry picked from commit 8899e85de100557899da05f0b37867a371a73800)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Doc/library/shutil.rst
Lib/shutil.py
Lib/test/test_shutil.py
Misc/NEWS.d/next/Library/2024-11-22-10-42-34.gh-issue-127035.UnbDlr.rst [new file with mode: 0644]