File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1131,9 +1131,16 @@ def execute(
11311131 information (stdout).
11321132
11331133 :param command:
1134- The command argument list to execute.
1135- It should be a sequence of program arguments, or a string. The
1136- program to execute is the first item in the args sequence or string.
1134+ The command to execute. A sequence of program arguments is the
1135+ recommended form when `shell` is ``False`` (the default), e.g.
1136+ ``["git", "log", "-n", "1"]``.
1137+
1138+ A string is accepted, but with `shell` set to ``False`` it is passed
1139+ as a single executable name to :class:`subprocess.Popen`. For example,
1140+ ``"git log -n 1"`` looks for an executable literally named
1141+ ``git log -n 1`` and will fail with :class:`GitCommandNotFound`. To
1142+ split a command string into argv tokens, pass ``shlex.split(...)`` as
1143+ a sequence or set `shell` to ``True`` (see the warning below).
11371144
11381145 :param istream:
11391146 Standard input filehandle passed to :class:`subprocess.Popen`.
You can’t perform that action at this time.
0 commit comments