[Python-Dev] Testing Socket Timeouts patch 1519025

"Martin v. Löwis" martin at v.loewis.de
Sun Jul 30 23:42:54 CEST 2006


Tony Nelson schrieb:
>> You can use GenerateConsoleCtrlEvent to send Ctrl-C to all processes
>> that share the console of the calling process.
[...]
> Martin, your advice is usually spot-on, but I don't always understand it.
> Maybe using it here is just complicated.  

This was really just in response to your remark that you couldn't
find a way to send Ctrl-C programmatically. I researched (in
the C library sources) how SIGINT was *generated* (through
SetConsoleCtrlHandler), and that let me to a way to generate

I didn't mean to suggest that you *should* use GenerateConsoleCtrlEvent,
only that you could if you wanted to.

> I expect that
> GenerateConsoleCtrlEvent() can be called through the ctypes module, though
> that would make backporting the test to 2.4 a bit more difficult.

Well, if there was general utility to that API, I would prefer exposing
it in the nt module. It doesn't quite fit into kill(2), as it doesn't
allow to specify a pid of the target process, so perhaps it doesn't
have general utility. In any case, that would have to wait for 2.6.

Regards,
Martin



More information about the Python-Dev mailing list