Author tim.peters
Recipients pitrou, tim.peters
Date 2013-10-25.21:36:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1382736984.31.0.401499741953.issue19399@psf.upfronthosting.co.za>
In-reply-to
Content
Well, when a timeout is specified, .join() passes exactly the timeout passed to _it_ to ._wait_for_tstate_lock(), which in turn passes exactly the same timeout to .acquire().  So the negative value must be coming from _communicate() (the

    self.stdout_thread.join(self._remaining_time(endtime))

line).

_remaining_time() in turn:

    def _remaining_time(self, endtime):
        """Convenience for _communicate when computing timeouts."""
        if endtime is None:
            return None
        else:
            return endtime - _time()

So that just subtracts and doesn't do anything to ensure the result is positive, nor does the calling site check the return value.  Most other _remaining_time() calls in subprocess.py *do* check the return value, so I think this is clearly a subprocess.py bug.
History
Date User Action Args
2013-10-25 21:36:24tim.peterssetrecipients: + tim.peters, pitrou
2013-10-25 21:36:24tim.peterssetmessageid: <1382736984.31.0.401499741953.issue19399@psf.upfronthosting.co.za>
2013-10-25 21:36:24tim.peterslinkissue19399 messages
2013-10-25 21:36:24tim.peterscreate