473,406 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Portably killing/signalling another process not supported?

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/Coo.../Recipe/347462)
but no portable solution.

John Nagle
Jan 26 '08 #1
2 1165
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/Coo.../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?

Jan 26 '08 #2
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/Coo.../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
Jan 26 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Jacek Popławski | last post by:
Hello. I am going to write python script which will read python command from socket, run it and return some values back to socket. My problem is, that I need some timeout. I need to say for...
6
by: Dakkar | last post by:
How can i control my program when someone kill it's process from the taskmanager my dispose script is working well if i close the program manually but if i kill it from taskmanager its not working...
0
by: Shruti A via .NET 247 | last post by:
hello group I have recently started working on .Net platform. I am facing one problem in killing and starting process from my aspx page. I am able to kill and start the same process from vb.net...
3
by: kunal.kewalramani | last post by:
I'm opening an Excel file using ASP.NET, but Excel process remains it is not killed, I tried killing it by using Quit() that is also not working, if anybody have any solution for this please help me...
10
by: shiry | last post by:
Hi, I need to do some important cleanup before my console application exists. I used the console ctrl event. This is working well and it fires for all cases, including the CTRL_CLOSE_EVENT (if I...
6
by: laststubborn | last post by:
Hi everybody, We have a very large database and high transaction volume. Time to time these transactions are locking each other and decrease the performance of the database. Is there any way...
8
by: Rain | last post by:
Does anyone know how i can kill a process using C#? im developing an asp.net web application using C# and the asp.net process doesnt die even if the application has already exited. So i need to...
2
by: tony.newsgrps | last post by:
Hi there, I'm trying to understand the impact of killing a process that owns a system mutex (used to ensure there is only 1 instance of my program running) Here is my code pretty much: try...
18
by: J.K. Baltzersen | last post by:
To whomever it may concern: I am using MS Visual C++ 6.0. I have a process A which instantiates an object C. At a later point the process A creates the thread B. The thread B has access...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.