Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Actually on Windows, it does use <code>cmd.exe</code> when <code>shell=True</code> - it prepends <code>cmd.exe /c</code> (it actually looks up the <code>COMSPEC</code> environment variable but defaults to <code>cmd.exe</code> if not present) to the shell arguments. (On Windows 95/98 it uses the intermediate <code>w9xpopen</code> program to actually launch the command).</p> <p>So the strange implementation is actually the <code>UNIX</code> one, which does the following (where each space separates a different argument):</p> <pre><code>/bin/sh -c gcc --version </code></pre> <p>It looks like the correct implementation (at least on Linux) would be:</p> <pre><code>/bin/sh -c "gcc --version" gcc --version </code></pre> <p>Since this would set the command string from the quoted parameters, and pass the other parameters successfully.</p> <p>From the <code>sh</code> man page section for <code>-c</code>:</p> <blockquote> <p><code>Read commands from the command_string operand instead of from the standard input. Special parameter 0 will be set from the command_name operand and the positional parameters ($1, $2, etc.) set from the remaining argument operands.</code></p> </blockquote> <p>This patch seems to fairly simply do the trick:</p> <pre><code>--- subprocess.py.orig 2009-04-19 04:43:42.000000000 +0200 +++ subprocess.py 2009-08-10 13:08:48.000000000 +0200 @@ -990,7 +990,7 @@ args = list(args) if shell: - args = ["/bin/sh", "-c"] + args + args = ["/bin/sh", "-c"] + [" ".join(args)] + args if executable is None: executable = args[0] </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload