This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kermode
Recipients georg.brandl, kermode, madprog, r.david.murray
Date 2009-04-13.04:03:58
SpamBayes Score 0.00017796597
Marked as misclassified No
Message-id <1239595440.26.0.996928067055.issue3440@psf.upfronthosting.co.za>
In-reply-to
Content
notepad.exe forms a side-by-side assembly with COMCTL32.DLL. So
SystemRoot must be included in the environment. The following example
works with Python 2.5.2 on Windows XP.

===============================================================
import struct, subprocess
import os

command = 'C:\\WINDOWS\\NOTEPAD.EXE'
env     = {'FOO': 'bar', 'SystemRoot': os.environ['SystemRoot']}
p = subprocess.Popen(command, env=env)

p.wait()

err = struct.unpack('I', struct.pack('i', p.returncode))[0]
print '%x (%d)'%(err, err)
===============================================================

I would suggest Popen adds SystemRoot to env if it is not present.
History
Date User Action Args
2009-04-13 04:04:00kermodesetrecipients: + kermode, georg.brandl, r.david.murray, madprog
2009-04-13 04:04:00kermodesetmessageid: <1239595440.26.0.996928067055.issue3440@psf.upfronthosting.co.za>
2009-04-13 04:03:59kermodelinkissue3440 messages
2009-04-13 04:03:58kermodecreate