Portably killing/signalling another process not supported?

John Nagle nagle at animats.com
Sat Jan 26 15:26:15 EST 2008


Christian Heimes wrote:
> John Nagle wrote:
>>     There doesn't seem to be any way to portably kill another process
>> in Python.  "os.kill" is Mac/Unix only.  The "signal" module only lets
>> you send signals to the current process.  And the "subprocess" module
>> doesn't have a "kill" function.
>>
>>     Subprocess objects really should have a portable "interrupt" or
>> "kill" function.  They already have "poll" and "wait", which have
>> to be implemented differently for different systems; that's the
>> logical place for "kill".
>>
>>     Yes, there are nonportable workarounds
>> (http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/347462)
>> but no portable solution.
> 
> We are looking for somebody to implement a portable and cross platform
> implementation of kill() and send_signal() for the subprocess module.
> Are you interested in working on a patch for Python 2.6 and 3.0?
> 
    Since I use 2.4 and 2.5, I'm  interested in something that
goes back to at least 2.4.

    The ActiveState solution above needs C modules that aren't part of
the regular CPython distribution, unfortunately.

				John Nagle



More information about the Python-list mailing list