Charles-Francois Natali <neolo...@free.fr> added the comment:

> Oh, I didn't know. In this case, is my commit 3664fc29e867 correct? I
> think that it is, because without the patch, subprocess may call poll()
> with a negative timeout, and so it is no more a timeout at all.
>

Yes, it looks correct.
But I think there are a couple places left where functions can be
called with a negative timeout, for example here :

  1537                 stdout, stderr =
self._communicate_with_select(input, endtime,
  1538
orig_timeout)
  1539
  1540             self.wait(timeout=self._remaining_time(endtime))

or here:

  1113             if self.stdout is not None:
  1114                 self.stdout_thread.join(self._remaining_time(endtime))
  1115                 if self.stdout_thread.isAlive():

Also, it might be simpler and cleaner to factorize the raising of the
TimeoutExpired exception inside _remaining_time, instead of scattering
this kind of checks around the file:

  1514                     remaining = self._remaining_time(endtime)
  1515                     if remaining <= 0:
  1516                         raise TimeoutExpired(self.args, timeout)

merging what's done in _check_timeout

----------

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

Reply via email to