Message213866
I think the 2.7 documentation is correct: the current directory when the call is made, and not cwd, is included in the search path. I'd suggest specifying args as ["c:\\python33\\workspace\\plink.exe"].
I think I may have mislead you earlier on the search path. The Windows call is:
CreateProcess(lpApplicationName, lpCommandLine, <other stuff>, lpCurrentDirectory, <other stuff>)
The first parameter to Popen ("args") becomes lpCommandLine. The "executable" parameter to Popen, which you're not setting, becomes lpApplicationName. So, you're calling CreateProcess(NULL, "plink.exe, ..., lpCurrentDirectory="c:\\python33\\workspace").
In this case, .exe would be added if missing. But, the search path rules seem to not include the directory pointed to by lpCurrentDirectory (aka cwd).
So I think this would work:
subprocess.Popen(["c:\\python33\\workspace\\plink.exe"], stdout=subprocess.PIPE, cwd="c:\\python33\\workspace")
or
subprocess.Popen(["plink"], executable="c:\\python33\\workspace\\plink.exe", stdout=subprocess.PIPE, cwd="c:\\python33\\workspace")
Unfortunately, I don't have a copy of 3.x on my Windows machine to test with. |
|
Date |
User |
Action |
Args |
2014-03-17 14:06:23 | eric.smith | set | recipients:
+ eric.smith, terry.reedy, r.david.murray, docs@python, Jovik, kathweaver |
2014-03-17 14:06:23 | eric.smith | set | messageid: <1395065183.54.0.241050156619.issue20927@psf.upfronthosting.co.za> |
2014-03-17 14:06:23 | eric.smith | link | issue20927 messages |
2014-03-17 14:06:23 | eric.smith | create | |
|