Title: subprocess.Popen doesn't inherits os.environ to the spawned processes
Type: Severity: normal
Components: Library Versions:
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: leosoto Nosy List: leosoto
Priority: Keywords:

Created on 2008-08-12.22:39:48 by leosoto, last changed 2008-08-12.22:59:31 by leosoto.

msg3427 (view) Author: Leonardo Soto (leosoto) Date: 2008-08-12.22:39:47
When no env is passed as argument to subprocess.Popen, CPython inherits
os.environ. Jython doesn't:

>>> import os
>>> from subprocess import Popen, PIPE
>>> os.environ['FOO'] = "foo"
>>> Popen("echo $FOO", shell=True, stdout=PIPE,stderr=PIPE)
msg3428 (view) Author: Leonardo Soto (leosoto) Date: 2008-08-12.22:40:48
As extra information, CPython uses os.execvp() when no env is passed to
Popen. That's why os.environ is inherited.
msg3429 (view) Author: Leonardo Soto (leosoto) Date: 2008-08-12.22:59:29
Fixed in r5163 (asm branch)
Date User Action Args
2008-08-12 22:59:31leosotosetstatus: open -> closed
resolution: fixed
messages: + msg3429
2008-08-12 22:40:48leosotosetmessages: + msg3428
2008-08-12 22:39:48leosotocreate