Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!news2.euro.net!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'exit': 0.07; 'problem?': 0.07; 'rebuild': 0.09; 'cc:addr:python-list': 0.10; '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; 'otoh,': 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:edu.au': 0.16; 'received:harvey.boardofstudies.nsw.edu.au': 0.16; 'received:homeip.net': 0.16; 'received:nsw.edu.au': 0.16; 'simpson': 0.16; 'task.': 0.16; 'wrote:': 0.17; "shouldn't": 0.17; 'issue.': 0.20; 'otherwise,': 0.20; 'cc:2**0': 0.23; 'task': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'done.': 0.27; 'initial': 0.28; 'cases,': 0.33; 'like:': 0.33; 'table': 0.35; 'something': 0.35; 'except': 0.36; 'but': 0.36; 'child': 0.36; 'received:au': 0.36; 'charset:us-ascii': 0.36; 'why': 0.37; 'subject:: ': 0.38; 'performance': 0.39; 'content- disposition:inline': 0.60; 'email addr:gmail.com': 0.63; 'costs': 0.64; 'angel': 0.93 Date: Wed, 19 Dec 2012 10:03:16 +1100 From: Cameron Simpson To: Dave Angel Subject: Re: os.system and subprocess odd behavior MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50D047FC.6050406@davea.name> User-Agent: Mutt/1.5.21 (2010-09-15) References: <50D047FC.6050406@davea.name> Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 1355871807 news.xs4all.nl 6898 [2001:888:2000:d::a6]:57938 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35081 On 18Dec2012 05:39, Dave Angel wrote: | On 12/18/2012 05:27 AM, Hans Mulder wrote: | > On 18/12/12 06:10:43, photonymous@gmail.com wrote: | >> I hope I understand the question... but shouldn't you wait for the process to complete before exiting? | >> | >> Something like: | >> | >> pid = subprocess.Popen(...) | >> pid.wait() | >> | >> Otherwise, it'll exit before the background process is done. | > Why would that be a problem? | | Because you don't want to bog the system down with a zombie task. A zombie task is just a process table slot; it costs the system almost nothing. It is untidy but except in extreme cases, not a performance or resource issue. OTOH, a child process that is still active (pointlessly) might be a problem... -- Cameron Simpson My initial work-around is to rebuild history. - gary@sci34hub.sci.com (Gary Heston)