Richard Oudkerk <shibt...@gmail.com> added the comment: 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.) ---------- versions: +Python 3.3 -Python 3.2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15408> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com