[Python-Dev] subprocess shell=True on Windows doesn't escape ^ character

Paul Moore p.f.moore at gmail.com
Sun Jun 15 09:54:50 CEST 2014


On 15 June 2014 00:15, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> However, it says the Windows version uses CreateProcess, which
> doesn't use PATH.

Huh? CreateProcess uses PATH:

>py -3.4
Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600
64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.check_call(['echo', 'hello'])
hello
0

"echo" is an executable "C:\Utils\GnuWin64\echo.exe" which is on PATH
but not in the current directory...

Paul


More information about the Python-Dev mailing list