This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sbt
Recipients doerwalter, sbt
Date 2012-07-23.08:09:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343030990.4.0.0122007645227.issue15408@psf.upfronthosting.co.za>
In-reply-to
Content
In Python 2.x, when the file object returned by popen() is garbage collected the process is automatically waited on, collecting the pid of the process.

In Python 3.x a wrapper object is used whose close method wait on the pid.  This close method is *not* invoked when the wrapper is garbage collected.  However, the set of dead pids cannot accumulate since dead pids get collected whenever os.popen()/subprocess.Popen() is used.

The old behaviour is only an advantage in a refcounted implementation of Python like CPython.  I am not sure that "fixing" the current behaviour is necessary.

Simply adding to the wrapper class a __del__() method which invokes close() will not work.  (One could instead use a weakref callback, but that is non-trivial.)
History
Date User Action Args
2012-07-23 08:09:50sbtsetrecipients: + sbt, doerwalter
2012-07-23 08:09:50sbtsetmessageid: <1343030990.4.0.0122007645227.issue15408@psf.upfronthosting.co.za>
2012-07-23 08:09:49sbtlinkissue15408 messages
2012-07-23 08:09:49sbtcreate