This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Jovik
Recipients Jovik, docs@python
Date 2014-03-14.16:59:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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."
Date User Action Args
2014-03-14 16:59:45Joviksetrecipients: + Jovik, docs@python
2014-03-14 16:59:45Joviksetmessageid: <>
2014-03-14 16:59:45Joviklinkissue20927 messages
2014-03-14 16:59:44Jovikcreate