New submission from Elja van Tol:

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 :) )

----------
components: Windows
messages: 213234
nosy: elja
priority: normal
severity: normal
status: open
title: COMSPEC with multiple paths breaks subprocess.call
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20894>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to