[Python-Dev] test_quopri, test_wait3, and test_popen2
"Martin v. Löwis"
martin at v.loewis.de
Fri Mar 24 08:47:18 CET 2006
Neal Norwitz wrote:
> I played with this some last night and found the same ordering. I
> have a different patch that also fixes the problem. It also fixes 2-3
> bugs I think. Basically the child could be waited on from outside
> popen (or from 2 threads). The question is what should we do if that
> happens?
As discussed in the patch: If the application calls wait() at some
point, or poll() (in the same thread or a different thread), then it
is correct if .wait() will raise an os.error (ECHILD) - the pid was
already waited on.
OTOH, _cleanup shouldn't mess with pids that the application still might
want to wait on; _cleanup should also clean out objects that already
have been waited on. So my proposal is that Popen3 objects should be
added to _active only in __del__.
Regards,
Martin
More information about the Python-Dev
mailing list