Message166212
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.) |
|
Date |
User |
Action |
Args |
2012-07-23 08:09:50 | sbt | set | recipients:
+ sbt, doerwalter |
2012-07-23 08:09:50 | sbt | set | messageid: <1343030990.4.0.0122007645227.issue15408@psf.upfronthosting.co.za> |
2012-07-23 08:09:49 | sbt | link | issue15408 messages |
2012-07-23 08:09:49 | sbt | create | |
|