473,624 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1185
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
9869
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 example: os.system("someapplication.exe") and kill it, if it waits longer than let's say 100 seconds
6
1669
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 how can i fix it my dispose script is like this protected override void Dispose(bool Disposing) { if (Disposing)
0
1143
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 but failed to do it from asp.net the exception that i am getting is :: "Couldn't get process information from remote machine." although i am doing it from the same machine from where i did it successfully using vb.net. don't know the route...
3
2004
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 out. ********************************************************************** Sent via Fuzzy Software @ http://www.fuzzysoftware.com/ Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
10
8477
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 close the application from the X botton). But on the contrary to what the MSDN indicates (ms-help://MS.VSCC.2003/MS.MSDNQTR.2003OCT.1033/dllproc/base/handlerroutine.htm), ending my process from the task manager did not fire the CTRL_CLOSE_EVENT....
6
4620
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 that I can automate the killing process when blocking and deadlock time is exceeded in certain time elipsade? Can somebody help me on this please? Regards
8
4712
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 kill the process someone.. does anyone know the code for this? thank you so much in advance!!!!
2
6224
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 { mutex=new System.Threading.Mutex( true, mutexName, out createdNew)
18
2528
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 to the object C.
0
8240
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8175
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8625
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8336
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7168
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
1791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1487
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.