Passing environment variable to subprocess causes failure

2009-02-03 Thread davidgould
I'm attempting to run subprocess and passing in an environment variable. When I do this the child process fails with an error. When I don't pass an environement variable it runs fine. BTW Running this code under Windows XP with Python 2.6.1 Code A: p = subprocess.Popen( ['python', '-V'], env={

Re: Passing environment variable to subprocess causes failure

2009-02-03 Thread MRAB
davidgo...@davidgould.com wrote: I'm attempting to run subprocess and passing in an environment variable. When I do this the child process fails with an error. When I don't pass an environement variable it runs fine. BTW Running this code under Windows XP with Python 2.6.1 Code A: p =

Re: Passing environment variable to subprocess causes failure

2009-02-03 Thread rdmurray
Quoth MRAB goo...@mrabarnett.plus.com: davidgo...@davidgould.com wrote: I'm attempting to run subprocess and passing in an environment variable. When I do this the child process fails with an error. When I don't pass an environement variable it runs fine. BTW Running this code

Re: Passing environment variable to subprocess causes failure

2009-02-03 Thread Miki
Code A: p = subprocess.Popen( ['python', '-V'], env={ 'PYTHONPATH': 'C:/ Documents and Settings/David Gould/workspace/DgTools/Common/Trunk/ Source' } ) print p.communicate()[0] print p.returncode Output: None -1072365564 My *guess* is that since PATH is not in the environment you're