Message85935
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. |
|
Date |
User |
Action |
Args |
2009-04-13 04:04:00 | kermode | set | recipients:
+ kermode, georg.brandl, r.david.murray, madprog |
2009-04-13 04:04:00 | kermode | set | messageid: <1239595440.26.0.996928067055.issue3440@psf.upfronthosting.co.za> |
2009-04-13 04:03:59 | kermode | link | issue3440 messages |
2009-04-13 04:03:58 | kermode | create | |
|