Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'example:': 0.03; 'indeed,': 0.07; 'received:edu.au': 0.07; 'anyway': 0.09; 'exception': 0.12; 'darren': 0.16; 'e.errno': 0.16; 'errno': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'posix': 0.16; 'pythonic': 0.16; 'received:202.125.174': 0.16; 'received:202.125.174.133': 0.16; 'received:boardofstudies.nsw.edu.au': 0.16; 'received:cskk.homeip.net': 0.16; 'received:harvey.boardofstudies.nsw.edu.au': 0.16; 'received:homeip.net': 0.16; 'received:nsw.edu.au': 0.16; 'cc:addr :python-list': 0.16; 'wrote:': 0.18; 'cc:no real name:2**0': 0.20; 'cheers,': 0.20; 'maybe': 0.21; 'header:In-Reply-To:1': 0.22; 'precise': 0.23; 'cc:2**0': 0.24; 'import': 0.27; 'raise': 0.28; 'pass': 0.29; 'cc:addr:python.org': 0.29; 'error': 0.29; 'correct': 0.29; 'header:User-Agent:1': 0.33; 'probably': 0.34; 'symbol': 0.34; 'try:': 0.34; 'something': 0.35; 'received:au': 0.36; '...': 0.36; 'subject:with': 0.36; 'charset:us-ascii': 0.37; 'but': 0.37; 'except': 0.37; 'think': 0.37; 'should': 0.39; 'else': 0.39; "it's": 0.40; 'more': 0.61; 'received:202': 0.66; 'cameron': 0.73; 'chek': 0.84; 'mandates': 0.84 Date: Tue, 3 Jan 2012 12:44:58 +1100 From: Cameron Simpson To: Devin Jeanpierre Subject: Re: Avoid race condition with Popen.send_signal MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) References: Cc: python-list@python.org 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1325555666 news.xs4all.nl 6869 [2001:888:2000:d::a6]:57919 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18361 On 02Jan2012 20:31, Devin Jeanpierre wrote: | > I think that catching the exception is probably the most Pythonic way. | | It's the only correct way. Indeed, but be precise - chek that it _is_ error 3, or more portably, errno.ESRCH. POSIX probably mandates that that is a 3, but the symbol should track the local system if it differs. Example: import errno ... try: ...signal... except OSError, e: if e.errno == errno.ESRCH: pass # or maybe an info log message else: raise # something else wrong - raise exception anyway Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ WHAT"S A ""K3WL D00D"" AND WH3R3 CAN 1 G3T S0M3!!!!!!!!!!!???????? - Darren Embry