Message213570
This works on Linux as expected:
import subprocess
proc = subprocess.Popen(["./app"], stdout=subprocess.PIPE, cwd="workspace")
but on Windows I get:
FileNotFoundError: [WinError 2] The system cannot find the file specified
To successfully execute it on Windows I need to set shell=True first:
proc = subprocess.Popen(["app.exe"], stdout=subprocess.PIPE, cwd="workspace", shell=True)
which is odd since by default it should use cwd when searching for binary:
"If cwd is not None, the function changes the working directory to cwd before executing the child. In particular, the function looks for executable (or for the first item in args) relative to cwd if the executable path is a relative path."
from http://docs.python.org/3.3/library/subprocess.html |
|
Date |
User |
Action |
Args |
2014-03-14 16:59:45 | Jovik | set | recipients:
+ Jovik, docs@python |
2014-03-14 16:59:45 | Jovik | set | messageid: <1394816385.18.0.912805951896.issue20927@psf.upfronthosting.co.za> |
2014-03-14 16:59:45 | Jovik | link | issue20927 messages |
2014-03-14 16:59:44 | Jovik | create | |
|