[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2019-02-20 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-36048: "Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__". -- ___ Python tracker

[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2018-08-23 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2018-08-23 Thread Michał Radwański
Michał Radwański added the comment: Although you're right - this issue is specific to pytime.c, when _Py_InIntegralTypeRange() is used with a double, it is actually true that _Py_InIntegralTypeRange() is used with double, in pytime.c only (as a quick recursive grep discovers). Perhaps the

[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2018-08-23 Thread STINNER Victor
STINNER Victor added the comment: I'm not sure that the pytime.c change in commit a853a8ba7850381d49b284295dd6f0dc491dbe44 is correct: diff --git a/Python/pytime.c b/Python/pytime.c index 8979adc219..f3c913226c 100644 --- a/Python/pytime.c +++ b/Python/pytime.c @@ -276,7 +278,6 @@ static int

[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2018-08-23 Thread STINNER Victor
STINNER Victor added the comment: It seems like a regression introduced by: commit a853a8ba7850381d49b284295dd6f0dc491dbe44 Author: Benjamin Peterson Date: Thu Sep 7 11:13:59 2017 -0700 bpo-31373: fix undefined floating-point demotions (#3396) --

[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2018-08-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2018-08-17 Thread Michał Radwański
Change by Michał Radwański : -- keywords: +patch pull_requests: +8278 stage: -> patch review ___ Python tracker ___ ___

[issue34423] Overflow when casting from double to time_t, and_PyTime_t.

2018-08-17 Thread Michał Radwański
New submission from Michał Radwański : Code triggering bug: import time time.sleep(2**63 / 10**9) Result: ValueError: sleep length must be non-negative The problem is with the macro that checks the range of provided double: Line 228 of Include/pymath.h: #define _Py_InIntegralTypeRange(type,