Portably killing/signalling another process not supported?

J

John Nagle

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.

John Nagle
 
C

Christian Heimes

John said:
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?
 
J

John Nagle

Christian said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top