Path: csiph.com!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:: [': 0.02; 'completeness': 0.05; 'subject:Error': 0.05; 'python': 0.08; 'dependant': 0.09; 'googled': 0.09; 'subprocess': 0.09; 'to:name :python-list@python.org': 0.15; '712': 0.16; 'currencies': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'from:addr:jpmorgan.com': 0.16; 'received:155.180': 0.16; 'received:159.53': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'securities,': 0.16; 'subject: \n ': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'subject:] ': 0.18; 'header:In-Reply- To:1': 0.22; 'itself,': 0.23; 'command': 0.24; 'subject:HELP': 0.24; 'function': 0.27; 'tried': 0.27; 'received:169': 0.28; 'received:169.254': 0.28; 'separate': 0.28; 'bit': 0.28; 'problem': 0.29; 'received:155': 0.30; 'received:159': 0.30; 'terminate': 0.30; 'creates': 0.31; 'accuracy': 0.32; 'does': 0.32; 'error.': 0.32; 'test': 0.34; 'running': 0.34; 'probably': 0.35; 'to:addr:python-list': 0.35; 'phone:': 0.35; 'created': 0.37; 'but': 0.37; 'charset:us-ascii': 0.37; 'skip:" 10': 0.37; 'could': 0.38; 'doing': 0.38; 'put': 0.40; 'to:addr:python.org': 0.40; 'your': 0.61; 'hope': 0.61; 'subject': 0.61; 'offers': 0.62; 'information,': 0.69; 'legal': 0.72; 'url:email': 0.72; 'bank': 0.75; 'sale': 0.75; 'investment': 0.77; 'purchase': 0.78; '[error': 0.84; 'received:169.254.8': 0.84; 'subject:Access': 0.84; 'killing': 0.91; 'subject: ! ': 0.91 X-DKIM: OpenDKIM Filter v2.1.3 sz1.jpmchase.com q21IG1r7014266 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=jpmorgan.com; s=smtpout; t=1330625761; bh=JtNIYSPxv9v283tl39bAnGYD/Mtuvg0fifwSzqX/mY0=; h=From:To:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=KO73lXXPfflQyithotQwA6yY42QNa+3H2AOEfDCzOWd3TP0yt1cpBJoUNhJPZjURT ITg2TAt9YIB6lBOhVSivau2lIjjc/CuImlYnH+LAvuaW26sKgKPJePZwMrqieURLSg d1ChJdOM/PuRJUsSm39upxZpEmHdKlpgCWmlwq9s= From: "Prasad, Ramit" To: "python-list@python.org" Subject: RE: HELP ! Popen.terminate() - WindowsError: [Error 5] Access is denied Thread-Topic: HELP ! Popen.terminate() - WindowsError: [Error 5] Access is denied Thread-Index: AQHM99JY/2CDaWh6M0S5u845XtdQaJZVvhmA Date: Thu, 1 Mar 2012 18:15:55 +0000 References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.79.38] Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DLP-FWD: Yes Content-Type: text/plain; charset="us-ascii" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1330625771 news.xs4all.nl 6919 [2001:888:2000:d::a6]:38183 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:21100 > Now when I put "proc=2Eterminate()" in my signal_handler() function to=0D= =0A> terminate the subprocess created as well,=0D=0A> It is giving me "Wind= owsError: [Error 5] Access is denied" error=2E=0D=0A> I have tried with os= =2Ekill() also, same error=2E Tried with Popen=2Ekill() also=0D=0A> same e= rror=2E Have googled a bit but couldn't understand them=2E=0D=0A> =0D=0A> I= n general, How to kill a subprocesses created from a python program=2E? If= =0D=0A> that subprocess also creates a new process from itself, how can I k= ill all=0D=0A> child processes from my main python script=2E?=0D=0A=0D=0AI = have not tested this, but you could get the pid by doing Popen=2Epid and=0D= =0Athen killing it from the command line by doing "taskkill /PID [pid]"=2E= =0D=0AThis is all dependant on the users ability to kill the task in the fi= rst place=2E=0D=0AIf that does not work then the problem is probably not Py= thon but Windows=2E=0D=0A=0D=0AYou could test by running your program and d= oing the taskkill in a separate=0D=0Acommand prompt=2E =0D=0A=0D=0AHope tha= t helps,=0D=0ARamit=0D=0A=0D=0A=0D=0ARamit Prasad | JPMorgan Chase Investme= nt Bank | Currencies Technology=0D=0A712 Main Street | Houston, TX 77002=0D= =0Awork phone: 713 - 216 - 5423=0D=0A=0D=0A--=0D=0A=0D=0A=0D=0AThis email i= s confidential and subject to important disclaimers and=0D=0Aconditions inc= luding on offers for the purchase or sale of=0D=0Asecurities, accuracy and = completeness of information, viruses,=0D=0Aconfidentiality, legal privilege= , and legal entity disclaimers,=0D=0Aavailable at http://www=2Ejpmorgan=2Ec= om/pages/disclosures/email=2E