Exception exceptions.AttributeError: "'NoneType' object has no attribute 'append'" in <bound method Popen.__del__ of <subprocess.Popen object at 0x2aaaab910950>> ignored
Is this a bug or a feature? Personally, I'd like to see these messages silenced, since it is being generated during interpreter shutdown. The following patch does the trick for me:
--- /usr/local/lib/python2.5/subprocess.py 2006-07-11 14:11:59.000000000 -0400
+++ subprocess.py 2006-07-12 10:17:09.000000000 -0400
@@ -613,7 +613,7 @@
return
# In case the child hasn't been waited on, check if it's done.
self.poll(_deadstate=sys.maxint)
- if self.returncode is None:
+ if self.returncode is None and _active is not None:
# Child is still running, keep us alive until we can wait on it.
_active.append(self)
Note that popen.py does something similar, though I am not convinced that the test is right or if it is doing something more subtle:
def __del__(self):
# In case the child hasn't been waited on, check if it's done.
self.poll(_deadstate=sys.maxint)
if self.sts < 0:
if _active:
# Child is still running, keep us alive until we can wait on it.
_active.append(self)
Regards,
-Kevin
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com