CreateProcess doesn't sort environment block
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
Win32 CreateProcess requires that the environment block be sorted alphabetically, case-insensitive. This isn't currently done by win32process, so subprocesses won't see all the environment vars in the dictionary. See the thread around http://mail.python.org/pipermail/python-dev/2004-October/049656.html
for a discussion of this, and how to solve it.
(This also affects the Popen class in the subprocess module, which takes an env argument and calls CreateProcess.)
Logged In: YES
user_id=34892
Originator: NO
I'll attach the patch that I am using for this in ActivePython builds. It doesn't do the absolutely correct thing as per the python-dev discussion you linked to. It is, instead, a "good enough for me so far" solution -- where "me" is usage in Komodo, where we hit the bug initially.
Logged In: YES
user_id=34892
Originator: NO
Uh, I *would* attach the patch, but I don't see how to do that on this bug item. SF Tracker sucks. The patch is here instead:
http://trentm.com/patches/pywin32_createprocess_env_fix.patch