which ideally would appear in the output somewhere. Your output is interesting as well, as it does point to a bug in subprocess. I'm not quite sure why __del__() would be called at a time when the Popen object doesn't have a _child_created attribute, that could only happen if __del__ was invoked by the _cleanup() method. If that happens, that would mean that the object gets destroyed while it hasn't even finished the constructor yet.
That actually wasn't the kind of debugging I was hoping for; I added these three prints
print '*** subprocess _cleanup'
print '*** _active type:', type(_active)
print '*** _active:', _active
which ideally would appear in the output somewhere. Your output is interesting as well, as it does point to a bug in subprocess. I'm not quite sure why __del__() would be called at a time when the Popen object doesn't have a _child_created attribute, that could only happen if __del__ was invoked by the _cleanup() method. If that happens, that would mean that the object gets destroyed while it hasn't even finished the constructor yet.