title: Unable to run command without shell=True in subprocess command
body: <p>I am developing a small tool with python in Linux. Earlier I was using Python 2.7 but now I changed it to Python 3.4 to see if it could help in solving my problem. When I am giving the following code:</p>
  
  <pre><code>try:
      x=subprocess.check_output(command, shell=True, timeout=3)
  except subprocess.TimeoutExpired as exc:
      print ("Timeout bro")
      exit()
  except Exception as e:
      msg = "Some issues in fetching details"
      print (msg)
  </code></pre>
  
  <p>Since the command fetches details from another device and the device is not functioning properly, it is getting timed out after 3 secs and printing the message "Timeout bro". I read the security issues with using shell=True and therefore I made it shell=False for one time and for the second I removed that argument.</p>
  
  <pre><code>try:
      x=subprocess.check_output(command, shell=False, timeout=3)
  except subprocess.TimeoutExpired as exc:
      print ("Timeout bro")
      exit()
  except Exception as e:
      msg = "Some issues in fetching details"
      print (msg)
  </code></pre>
  
  <p>I read at various places that the command works equally well with shell=False. But as soon as I run the above code with <code>shell=False</code> the code directly prints "Some issues in fetching details" without waiting for 3 secs. Is there any way through which I can run the code without shell=True? Please help. Thanks!</p>