title: subprocess.call doesn't work as expected
body: <p>I have the following batch file (test.bat)</p>
  
  <pre><code>my.py &lt; commands.txt
  </code></pre>
  
  <p>my.py does the following:</p>
  
  <pre><code>import sys
  
  print sys.stdin.readlines()
  </code></pre>
  
  <p>Everything works fine if I launch this batch file from command line (from cmd.exe shell in Windows 7).</p>
  
  <p>But if I try to run it via <code>subprocess.call</code> function from python it doesn't work.</p>
  
  <p>How I try to run it from python:</p>
  
  <pre><code>import subprocess
  import os
  
  # Doesn't work !
  rc = subprocess.call("test.bat", shell=True)
  print rc
  </code></pre>
  
  <p>And this is the error message that I get:</p>
  
  <pre><code>&gt;my.py  0&lt;commands.txt
  Traceback (most recent call last):
    File "C:\Users\.....\my.py
  ", line 3, in &lt;module&gt;
      print sys.stdin.readlines()
  IOError: [Errno 9] Bad file descriptor
  1
  </code></pre>
  
  <p>I'm using python 2.7.2 but on 2.7.5 I get the same behavior.</p>
  
  <p>Any ideas?</p>