<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY>
<DIV>
<DIV><SPAN class=743574000-21072006><FONT face=Arial><FONT color=#0000ff><FONT
size=2>Hah - just found it. I even remember reading it.<SPAN
class=350324400-21072006>..</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=743574000-21072006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=743574000-21072006><FONT face=Arial color=#0000ff size=2>I'll
update the SF tracker (1526203) with your analysis.</FONT></SPAN></DIV>
<DIV><SPAN class=743574000-21072006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=743574000-21072006><FONT face=Arial color=#0000ff size=2>Tim
Delaney</FONT></SPAN></DIV></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
python-dev-bounces+tdelaney=avaya.com@python.org
[mailto:python-dev-bounces+tdelaney=avaya.com@python.org] <B>On Behalf Of
</B>Kevin Jacobs <jacobs@bioinformed.com><BR><B>Sent:</B> Thursday, 13
July 2006 12:33 AM<BR><B>To:</B> python-dev@python.org<BR><B>Subject:</B>
[Python-Dev] Behavior change in subprocess.py<BR><BR></FONT></DIV>During my
testing of Python 2.5b2, I've found something that may be worthy of
discussion. I suspect that recent GC and finalization changes have
altered the behavior of the Popen object in subprocess.py. I am now
getting many many many finalization warnings in my code like:
<BR><BR>Exception exceptions.AttributeError: "'NoneType' object has no
attribute 'append'" in <bound method Popen.__del__ of <subprocess.Popen
object at 0x2aaaab910950>> ignored<BR><BR>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: <BR><BR>---
/usr/local/lib/python2.5/subprocess.py
2006-07-11 14:11:59.000000000 -0400<BR>+++
subprocess.py 2006-07-12
10:17:09.000000000 -0400<BR>@@ -613,7 +613,7
@@<BR>
return<BR> # In case the child
hasn't been waited on, check if it's done.
<BR>
self.poll(_deadstate=sys.maxint)<BR>-
if self.returncode is None:<BR>+ if
self.returncode is None and _active is not
None:<BR>
# Child is still running, keep us alive until we can wait on it.
<BR>
_active.append(self)<BR><BR><BR>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:<BR><BR> def
__del__(self):<BR> # In case the
child hasn't been waited on, check if it's done.
<BR>
self.poll(_deadstate=sys.maxint)<BR>
if self.sts <
0:<BR> if
_active:<BR>
# Child is still running, keep us alive until we can wait on
it.<BR>
_active.append(self)
<BR><BR>Regards,<BR>-Kevin<BR><BR></BLOCKQUOTE></BODY></HTML>