Skip to content

gh-101283: Fix use of unbound variable #101712

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 1 commit into from
Feb 8, 2023
Merged
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions Lib/subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,8 @@ def _execute_child(self, args, executable, preexec_fn, close_fds,
raise FileNotFoundError('shell not found: neither %ComSpec% nor %SystemRoot% is set')
if os.path.isabs(comspec):
executable = comspec
else:
comspec = executable

args = '{} /c "{}"'.format (comspec, args)
Comment on lines +1498 to 1500
Copy link
Contributor

@eryksun eryksun Feb 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value of args should quote comspec. Otherwise the shell process won't parse its command line correctly if comspec contains spaces.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a problem before too, so let's make it a new issue. Assuming the backports for the original change go it, it'll automatically flow back smoothly enough (whereas this PR may not).


Expand Down