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


Groups > comp.lang.python > #90955

subprocess.Popen zombie

From Robin Becker <robin@reportlab.com>
Subject subprocess.Popen zombie
Date 2015-05-20 14:16 +0100
Newsgroups comp.lang.python
Message-ID <mailman.170.1432127818.17265.python-list@python.org> (permalink)

Show all headers | 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