[Python-Dev] Draft PEP and reference implementation of a Python launcher for Windows

Curt Hagenlocher curt at hagenlocher.org
Mon Mar 21 03:15:41 CET 2011


On Sun, Mar 20, 2011 at 6:27 PM, "Martin v. Löwis" <martin at v.loewis.de> wrote:
>
> I'm primarily bothered about the failure to implement TerminateProcess
> correctly. I don't actually know what use cases would be affected, other
> then saying that anything launching py.exe could be affect, in
> particular applications using ShellExecuteEx. I don't think it is
> feasible to change them all to launch something different instead; some
> may be out of our control. Potential candidates would be web servers.

This can be worked around, depending on the level of inelegance you're
willing to accept. A third watchdog process could wait on the launcher
being terminated, and use that to terminate the child Python.exe
process. Alternatively, the launcher could inject a sentinel thread
into the Python.exe process using CreateRemoteThread. Both approaches
would work for any target implementation or bitness of Python.

-Curt


More information about the Python-Dev mailing list