Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Apply suggestions from code review
  • Loading branch information
zooba authored Feb 8, 2023
commit fd3390bca981376617e31fc325ef07e6e4415859
10 changes: 5 additions & 5 deletions Doc/library/subprocess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ compatibility with older versions, see the :ref:`call-function-trio` section.
Added the *text* parameter, as a more understandable alias of *universal_newlines*.
Added the *capture_output* parameter.

.. versionchanged:: 3.11.2
.. versionchanged:: 3.8.17

Changed Windows shell search order for ``shell=True``. The current
directory and ``%PATH%`` are replaced with ``%COMSPEC%`` and
Expand Down Expand Up @@ -467,7 +467,7 @@ functions.
*executable* parameter accepts a bytes and :term:`path-like object`
on Windows.

.. versionchanged:: 3.11.2
.. versionchanged:: 3.8.17

Changed Windows shell search order for ``shell=True``. The current
directory and ``%PATH%`` are replaced with ``%COMSPEC%`` and
Expand Down Expand Up @@ -1093,7 +1093,7 @@ calls these functions.
.. versionchanged:: 3.3
*timeout* was added.

.. versionchanged:: 3.11.2
.. versionchanged:: 3.8.17

Changed Windows shell search order for ``shell=True``. The current
directory and ``%PATH%`` are replaced with ``%COMSPEC%`` and
Expand Down Expand Up @@ -1131,7 +1131,7 @@ calls these functions.
.. versionchanged:: 3.3
*timeout* was added.

.. versionchanged:: 3.11.2
.. versionchanged:: 3.8.17

Changed Windows shell search order for ``shell=True``. The current
directory and ``%PATH%`` are replaced with ``%COMSPEC%`` and
Expand Down Expand Up @@ -1194,7 +1194,7 @@ calls these functions.
.. versionadded:: 3.7
*text* was added as a more readable alias for *universal_newlines*.

.. versionchanged:: 3.11.2
.. versionchanged:: 3.8.17

Changed Windows shell search order for ``shell=True``. The current
directory and ``%PATH%`` are replaced with ``%COMSPEC%`` and
Expand Down
2 changes: 2 additions & 0 deletions Lib/subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,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

Comment thread
zooba marked this conversation as resolved.
args = '{} /c "{}"'.format (comspec, args)

Expand Down