Lenard Lindstrom <le...@telus.net> added the comment: 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue3440> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com