[Python-Dev] FW: Bug? Certainly a new behavior from subprocess in 2.5 on Win32 (original) (raw)

Georg Brandl g.brandl at gmx.net
Fri Jul 21 19:39:40 CEST 2006


Kevin Jacobs <jacobs at bioinformed.com> wrote:

On 7/21/06, Nick Coghlan <ncoghlan at gmail.com_ _<mailto:ncoghlan at gmail.com>> wrote:

Delaney, Timothy (Tim) wrote: > Looks like there's a bug in Popen.del in 2.5. I'm not in a position > to have a look right now. For those not watching python-checkins, a check for "is not None" has been added before the offending line in Popen.del. (by Georg, IIRC)

Many thanks for accepting my patch. There remains a potentially related problem in popen2.py, but it may be a lower priority, since most folks should be using subprocess. 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) The is active check, unless it intendeds to check for either empty or None, should probably be revised to: 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 is None: # Child is still running, keep us alive until we can wait on it. active.append(self) However, there may be a clever reason for doing what is doing that I do not see.

There's no reason (I know since I added the check myself ;). Thanks for pointing out that obvious bug. (fixed in rev 50759).

Georg



More information about the Python-Dev mailing list