subprocess piping output on Windows
<p>I've got this piece of code that works fine on Linux but fails on Windows. Process is created fine, but I get an error and nothing is read from pipe:</p>

<pre><code>    p = subprocess.Popen(['python', '-u', self.file_to_run,
                                   '-s', '-g', '-i', self.input_file],
                                   universal_newlines=True,
                                   stdout=subprocess.PIPE)
    ...
    out = p.stdout.readline().rstrip()
</code></pre>

<p>Error I get is</p>

<pre><code>Traceback (most recent call last):
  File "bench.py", line 59, in &lt;module&gt;
    multi.add_process()
  File "bench.py", line 47, in add_process
    stdout=subprocess.PIPE)
  File "c:\python\v2.5.1-ast3\...\lib\subprocess.py", line 615, in __init__
    self.stdout = os.fdopen(c2pread, 'rU', bufsize)
OSError: [Errno 22] Invalid argument
</code></pre>

<p>I actually create multiple such processes and based on their output calculate some values, but that is irrelevant. What I need to do is, run the script with certain arguments multiple times and parse the data piped from stdout of each process.</p>
