← 返回首页
GH-75586: Fix case where PATHEXT isn't applied to items in PATH (Windows) by csm10495 · Pull Request #103179 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

GH-75586: Fix case where PATHEXT isn't applied to items in PATH (Windows)#103179

Merged
zooba merged 31 commits into
python:mainfrom
csm10495:fix_which_pathext_windows
Apr 4, 2023
Merged

GH-75586: Fix case where PATHEXT isn't applied to items in PATH (Windows)#103179
zooba merged 31 commits into
python:mainfrom
csm10495:fix_which_pathext_windows

Conversation

csm10495 commented Apr 2, 2023

Copy link
Copy Markdown
Contributor

GH-75586 - Fix case where PATHEXT isn't applied to items in PATH.

The logic change here makes it so that if the command passed into shutil.which on windows, it will be verified against how it is passed in and against the various items in PATHEXT.

For example:

shutil.which('C:/windows/system32/cmd')

will now return

'C:/windows/system32/cmd.EXE'

Instead of None.

If this looks good, I'd be happy to create a changelog entry, etc. Just feeling the water with this first commit.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.12 only security fixes OS-windows stdlib Standard Library Python modules in the Lib/ directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Footer

© 2026 GitHub, Inc.