title: Python command erro 500
body: <p>I am trying to execute a <code>subprocess.Popen()</code> command. But it is returning error 500 when my JavaScript invokes the program via <code>XmlHttpRequest()</code>.</p>
  
  <p>The error is:</p>
  
  <blockquote>
    <p>GET <a href="http://177.55.99.146:8080/autenticacao/autentica?arquivo=[object%20File]" rel="nofollow">http://177.55.99.146:8080/autenticacao/autentica?arquivo=[object%20File]</a> 500 (Internal Server Error)</p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>import subprocess
  from subprocess import Popen, PIPE, STDOUT
  def chamaProg(arquivo): 
     p = Popen(['java -Djava.library.path="C:\\Nitgen" -jar C:\\Nitgen\\Busca3-N_java.jar',arquivo], stdin=arquivo, stdout=PIPE, stderr=STDOUT, close_fds=True)
     output = p.stdout.read()
     print output   
     return p
  </code></pre>
  
  <p>What am I doing wrong?</p>