bpo-30807: signal.setitimer() may disable the timer by mistake#2493
bpo-30807: signal.setitimer() may disable the timer by mistake#2493pitrou merged 2 commits intopython:masterfrom
Conversation
|
@pitrou, thanks for your PR! By analyzing the history of the files in this pull request, we identified @tiran, @rosslagerwall and @giampaolo to be potential reviewers. |
| # Check that float -> timeval conversion doesn't round | ||
| # the interval down to zero, which would disable the timer. | ||
| self.itimer = signal.ITIMER_REAL | ||
| signal.setitimer(self.itimer, 1e-6) |
There was a problem hiding this comment.
I suggest to test 1e-9 to make sure that it's smaller than 1 us, since 1e-6 is not an exact floating number number.
>>> (1e-6).hex()
'0x1.0c6f7a0b5ed8dp-20'
There was a problem hiding this comment.
You don't understand. 1e-6 is the minimum advertised resolution for setitimer, that's why it's supposed to work.
There was a problem hiding this comment.
On the other hand, your suggestion would make the test fail reliably without the patch. I'm on the (signal) fence.
| @@ -0,0 +1,6 @@ | |||
| signal.setitimer() may disable the timer when passed a tiny value. | |||
|
|
|||
| Tiny values (such as 1e-6) are valid non-zero values for setitimer(), which | |||
There was a problem hiding this comment.
Hum, I'm not sure about your Git-commit-message-like formatting. I may be needed to agree on a style on python-dev.
There was a problem hiding this comment.
I don't really care about this :-)
…ythonGH-2493) * bpo-30807: signal.setitimer() may disable the timer by mistake * Add NEWS blurb (cherry picked from commit 729780a)
|
GH-2497 is a backport of this pull request to the 3.6 branch. |
…ythonGH-2493) * bpo-30807: signal.setitimer() may disable the timer by mistake * Add NEWS blurb (cherry picked from commit 729780a)
|
GH-2498 is a backport of this pull request to the 3.5 branch. |
…ythonGH-2493) * bpo-30807: signal.setitimer() may disable the timer by mistake * Add NEWS blurb. (cherry picked from commit 729780a)
|
GH-2499 is a backport of this pull request to the 2.7 branch. |
No description provided.