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


Groups > comp.lang.python > #90955

subprocess.Popen zombie

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:skip:s 10': 0.07; 'suppose': 0.07; 'executed': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'seemed': 0.09; 'worse': 0.09; 'alert': 0.16; 'anyhow,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'slight': 0.16; 'somehow.': 0.16; 'sound,': 0.16; 'looked': 0.18; 'app': 0.19; 'module': 0.19; 'command': 0.22; 'appears': 0.22; 'handles': 0.22; 'header:User- Agent:1': 0.23; 'convenient': 0.24; 'script': 0.25; 'header:X -Complaints-To:1': 0.27; 'record': 0.27; 'skip:p 30': 0.29; "i'm": 0.30; 'code': 0.31; 'fine,': 0.31; 'loading': 0.31; 'way?': 0.31; 'linux': 0.33; 'running': 0.33; 'etc': 0.35; 'but': 0.35; 'version': 0.36; 'doing': 0.36; 'next': 0.36; 'behind': 0.37; 'process,': 0.38; 'window': 0.38; 'needed': 0.38; 'to:addr:python- list': 0.38; 'previous': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'around.': 0.60; 'commands': 0.60; 'new': 0.61; 'decided': 0.64; 'received:109': 0.72; 'disappears': 0.84; 'reap': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Robin Becker <robin@reportlab.com>
Subject subprocess.Popen zombie
Date Wed, 20 May 2015 14:16:44 +0100
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 109.174.168.73
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.170.1432127818.17265.python-list@python.org> (permalink)
Lines 23
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1432127818 news.xs4all.nl 2851 [2001:888:2000:d::a6]:49011
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:90955

Show key headers only | View raw


As part of a long running PyQT process running as a window app in Arch linux I 
needed an alert sound, I decided to use the beep command and the app code then 
looked like

pid = Popen(['/home/robin/bin/mybeep', '-r3', '-f750', '-l100', '-d75']).pid

the mybeep script handles module loading if required etc etc.

Anyhow, this works with one slight oddity. When this code is executed it works 
fine, but leaves behind a single zombie process, when next executed the zombie 
disappears and a new zombie replaces it.

Is this because I'm not waiting? Does the process module reap previous commands 
in some way? The code I used to use with os.spawnl was even worse in leaving 
zombies around. I suppose I needed to keep a record of all the pid's and wait on 
them at some convenient time. The subprocess version appears to be doing that 
for me somehow.


*NB* I did try PyQT's qApp.beep(), but it seemed to work only on windows.
-- 
Robin Becker

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

subprocess.Popen zombie Robin Becker <robin@reportlab.com> - 2015-05-20 14:16 +0100
  Re: subprocess.Popen zombie Cecil Westerhof <Cecil@decebal.nl> - 2015-05-20 16:48 +0200
  Re: subprocess.Popen zombie Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2015-05-20 17:42 +0200
    Re: subprocess.Popen zombie Robin Becker <robin@reportlab.com> - 2015-05-20 17:44 +0100
      Re: subprocess.Popen zombie Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2015-05-21 08:35 +0200
        Re: subprocess.Popen zombie Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-21 08:13 -0600

csiph-web