Issue 20894: COMSPEC with multiple paths breaks subprocess.call (original) (raw)

Issue20894

Created on 2014-03-12 10:02 by elja, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg213234 - (view) Author: Elja van Tol (elja) Date: 2014-03-12 10:02
I tried a simple console command: import subprocess subprocess.call(["dir"], shell=True) Which failed with an WindowsError 2, (could not find file) After much googling i found out that this is caused by os.environ['COMSPEC'] (http://stackoverflow.com/questions/20330385/cannot-find-the-file-specified-when-using-subprocess-calldir-shell-true-in#comment30370433_20335954) At first my COMSPEC was: C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\welja\AppData\Roaming\Composer\vendor\phpunit\phpunit;C:\Python27; I added ;%SystemRoot%\System32\cmd.exe but that failed. I then changed COMSPEC to only contain %SystemRoot%\System32\cmd.exe and that worked. ( Please fix this for others like me, users stuck on windows with no knowlegde of Python who just try to get Fabric to work to deploy some PHP sites :) )
msg213261 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-03-12 14:36
This was a misconfiguration of your system. It is not a bug in Python. (Unless can find a microsoft reference that says that COMPSPEC can contain more than one path? I don't think you will; see, eg: http://superuser.com/questions/446595/is-it-valid-for-comspec-to-have-multiple-entries)
msg213274 - (view) Author: Elja van Tol (elja) Date: 2014-03-12 18:17
I stand corrected, now i have to find out why my comspec was filled with nonsense. Sorry for the trouble!
History
Date User Action Args
2022-04-11 14:57:59 admin set github: 65093
2014-03-12 18:17:50 elja set messages: +
2014-03-12 14:36:45 r.david.murray set status: open -> closednosy: + r.david.murraymessages: + resolution: not a bugstage: resolved
2014-03-12 14:04:13 yselivanov set nosy: + brian.curtin
2014-03-12 10:02:25 elja create