Message133406
| Author |
neologix |
| Recipients |
gregory.p.smith, neologix, pitrou, python-dev, rnk, vstinner |
| Date |
2011年04月09日.18:13:32 |
| SpamBayes Score |
1.1265783e-10 |
| Marked as misclassified |
No |
| Message-id |
<BANLkTim1QMEePYdewVD+EUcjKe0Mr20nvA@mail.gmail.com> |
| In-reply-to |
<1302247212.14280.8.camel@marge> |
| Content |
> 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 |
|