title: Why does subprocess.Popen() with shell=True work differently on Linux vs Windows?
body: <p>When using <code>subprocess.Popen(args, shell=True)</code> to run "<code>gcc --version</code>" (just as an example), on Windows we get this:</p>
  
  <pre><code>&gt;&gt;&gt; from subprocess import Popen
  &gt;&gt;&gt; Popen(['gcc', '--version'], shell=True)
  gcc (GCC) 3.4.5 (mingw-vista special r3) ...
  </code></pre>
  
  <p>So it's nicely printing out the version as I expect. But on Linux we get this:</p>
  
  <pre><code>&gt;&gt;&gt; from subprocess import Popen
  &gt;&gt;&gt; Popen(['gcc', '--version'], shell=True)
  gcc: no input files
  </code></pre>
  
  <p>Because gcc hasn't received the <code>--version</code> option.</p>
  
  <p>The docs don't specify exactly what should happen to the args under Windows, but it does say, on Unix, <em>"If args is a sequence, the first item specifies the command string, and any additional items will be treated as additional shell arguments."</em> IMHO the Windows way is better, because it allows you to treat <code>Popen(arglist)</code> calls the same as <code>Popen(arglist, shell=True)</code> ones.</p>
  
  <p><strong>Why the difference between Windows and Linux here?</strong></p>