Message213645
I'm quite aware of the os.sep issues between the systems, but I checked both out of curiosity. Here are latest results:
All of the following commands raises the same exception:
>>> proc = subprocess.Popen("plink", stdout=subprocess.PIPE, cwd="c:\\python33\\workspace")
>>> proc = subprocess.Popen("plink", stdout=subprocess.PIPE, cwd="c:\\python33\\workspace\\")
>>> proc = subprocess.Popen(".\plink", stdout=subprocess.PIPE, cwd="c:\python33\workspace")
>>> proc = subprocess.Popen(".\\plink", stdout=subprocess.PIPE, cwd="c:\\python33\\workspace")
>>> proc = subprocess.Popen("plink", stdout=subprocess.PIPE, cwd="c:/python33/workspace")
Traceback (most recent call last):
File "C:\Python33\lib\subprocess.py", line 1104, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python33\lib\subprocess.py", line 819, in __init__
restore_signals, start_new_session)
File "C:\Python33\lib\subprocess.py", line 1110, in _execute_child
raise WindowsError(*e.args)
FileNotFoundError: [WinError 2] The system cannot find the file specified
But, when I set shell=True, then everything works just fine:
>>> proc = subprocess.Popen("plink", stdout=subprocess.PIPE, cwd="c:\python33\workspace", shell=True)
>>> proc = subprocess.Popen(".\plink", stdout=subprocess.PIPE, cwd="c:\\python33\\workspace", shell=True)
>>> proc = subprocess.Popen(".\\plink", stdout=subprocess.PIPE, cwd="c:\\python33\\workspace", shell=True)
>>> proc = subprocess.Popen("plink", stdout=subprocess.PIPE, cwd="c:/python33/workspace", shell=True)
I can get plink's output afterwards with proc.communicate() |
|
Date |
User |
Action |
Args |
2014-03-15 08:01:34 | Jovik | set | recipients:
+ Jovik, terry.reedy, eric.smith, r.david.murray, docs@python |
2014-03-15 08:01:34 | Jovik | set | messageid: <1394870494.51.0.715046392804.issue20927@psf.upfronthosting.co.za> |
2014-03-15 08:01:34 | Jovik | link | issue20927 messages |
2014-03-15 08:01:34 | Jovik | create | |
|