Tim Peters added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19399>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to