Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #21100 > unrolled thread

RE: HELP ! Popen.terminate() - WindowsError: [Error 5] Access is denied

Started by"Prasad, Ramit" <ramit.prasad@jpmorgan.com>
First post2012-03-01 18:15 +0000
Last post2012-03-01 18:15 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  RE: HELP ! Popen.terminate() - WindowsError: [Error 5] Access is denied "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-03-01 18:15 +0000

#21100 — RE: HELP ! Popen.terminate() - WindowsError: [Error 5] Access is denied

From"Prasad, Ramit" <ramit.prasad@jpmorgan.com>
Date2012-03-01 18:15 +0000
SubjectRE: HELP ! Popen.terminate() - WindowsError: [Error 5] Access is denied
Message-ID<mailman.330.1330625771.3037.python-list@python.org>
> Now when I put "proc.terminate()" in my signal_handler() function to
> terminate the subprocess created as well,
> It is giving me "WindowsError: [Error 5] Access is denied" error.
> I have tried with os.kill() also, same error.  Tried with Popen.kill() also
> same error. Have googled a bit but couldn't understand them.
> 
> In general,  How to kill a subprocesses created from a python program.? If
> that subprocess also creates a new process from itself, how can I kill all
> child processes from my main python script.?

I have not tested this, but you could get the pid by doing Popen.pid and
then killing it from the command line by doing "taskkill /PID [pid]".
This is all dependant on the users ability to kill the task in the first place.
If that does not work then the problem is probably not Python but Windows.

You could test by running your program and doing the taskkill in a separate
command prompt. 

Hope that helps,
Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web