title: send_file() giving error saying invalid mode 'rb'
body: <p>I am converting a Python script to an .exe file using <code>pyinstaller</code>. Then using <code>send_file()</code> in Flask, I am sending it to the client. I am getting an error:</p>
  
  <blockquote>
    <p>IOError: [Errno 22] invalid mode ('rb') or filename:
    'C:\Users\Dell\Desktop\mummy\dist\tc.exe'</p>
  </blockquote>
  
  <p>Here <code>tc.exe</code> is the executable I want to send and it's located in the dist folder.</p>
  
  <p>This code doesn't give any error and gets send using send_file:</p>
  
  <pre><code>import subprocess
  print ("hi")
  subprocess.call('ipconfig &gt; zzz.txt', shell = True)
  x = raw_input()
  </code></pre>
  
  <p>But my code (it checks whether system has python installed) gives error:</p>
  
  <pre><code>import sys
  import subprocess
  
  subprocess.call('python -V 2&gt; z1.txt' , shell = True)
  var1 = subprocess.call('find /i "not recognized" z1.txt', shell = True)
  subprocess.call('del z1.txt' , shell = True)
  if(var1 == 0):
      print ("python not found")
  else:
      print ("python found")
  x=raw_input()
  </code></pre>
  
  <p>(It calls the python version in the cmd prompt and stores it in a text file. Then it checks whether "not found" keyword is present in the text file. If it's present that means python is not installed)</p>
  
  <p>The raw_input() is given for the screen to wait for me see the output. </p>
  
  <p>What is the difference between the two files that i get error while sending one and not while sending the other?</p>