8000 gh-101283: Try to load the fallback cmd.exe by an absolute path by arhadthedev · Pull Request #101286 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-101283: Try to load the fallback cmd.exe by an absolute path #101286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Feb 8, 2023
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d122f14
Try to load the fallback cmd.exe by an absolute path
arhadthedev Jan 24, 2023
e96457c
Add a NEWS entry
arhadthedev Jan 24, 2023
b26918e
Fix minor grammar
arhadthedev Jan 24, 2023
9a0fdbd
Address patchcheck CI error report
arhadthedev Jan 24, 2023
091e970
Address the review
arhadthedev Jan 24, 2023
a3cbdb6
Simplify NEWS wording and reattribute the totally rewritten PR
arhadthedev Jan 24, 2023
8dab7f1
Address the review-2
arhadthedev Jan 24, 2023
1d8d4a6
Update Lib/subprocess.py
arhadthedev Jan 24, 2023
9ed1758
Simplify the NEWS entry
arhadthedev Jan 25, 2023
a2734a6
Clarify attribution
arhadthedev Jan 25, 2023
407aa35
Update 2023-01-24-16-12-00.gh-issue-101283.9tqu39.rst
arhadthedev Jan 25, 2023
f1dfcff
Merge branch 'main' into absolute-cmdexe-fallback-patch
arhadthedev Jan 28, 2023
880d443
Add `Changed in version` entries
arhadthedev Jan 28, 2023
b34f998
Try another multiversion syntax
arhadthedev Jan 28, 2023
84cf94f
Try the third, multiline syntax
arhadthedev Jan 28, 2023
9cbdfca
Apply the gpshead's suggestion
arhadthedev Jan 30, 2023
8bfb11b
Merge branch 'main' into absolute-cmdexe-fallback-patch
arhadthedev Jan 31, 2023
86473da
Address the review
arhadthedev Feb 8, 2023
f1b4412
Apply suggestions from code review
arhadthedev Feb 8, 2023
11ebd69
Improve performance by triggering `cmd.exe` search on `executable=Non…
arhadthedev Feb 8, 2023
25dcbb8
Update the Changed In section
arhadthedev Feb 8, 2023
fc08548
Update Lib/subprocess.py
arhadthedev Feb 8, 2023
7e06703
Fix env variable name misquoting
arhadthedev Feb 8, 2023
81aba86
Manually fix env variable name misquoting
arhadthedev Feb 8, 2023
fecd606
Update Lib/subprocess.py
arhadthedev Feb 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address the review
Co-authored-by: Eryk Sun <eryksun@gmail.com>
  • Loading branch information
arhadthedev and eryksun authored Jan 24, 2023
commit 091e970370d5694bd559a6c299eb40a658d06dda
9 changes: 6 additions & 3 deletions Lib/subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -1482,11 +1482,14 @@ def _execute_child(self, args, executable, preexec_fn, close_fds,
startupinfo.wShowWindow = _winapi.SW_HIDE
# gh-101283: with no full path, Windows looks into a
# current directory first so no plain "cmd.exe".
default_shell = "C:\\WINDOWS\\system32\\cmd.exe"
comspec = os.environ.get("COMSPEC", default_shell)
system_drive = os.environ.get('SystemDrive') or 'C:'
system_root = os.environ.get('SystemRoot') or os.path.join(
system_drive, 'Windows')
comspec = os.environ.get('ComSpec') or os.path.join(
system_root, 'System32', 'cmd.exe')
if not os.path.isfile(comspec):
# Windows is installed into a non-standard location
# or the system environment variable is broken.
# or the system environment variables are broken.
# It's highly unlikely and we cannot help here.
comspec = "cmd.exe"

Expand Down
0