This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Jeffrey.Walton, vstinner
Date 2014-03-16.20:38:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1395002337.27.0.843459132125.issue20941@psf.upfronthosting.co.za>
In-reply-to
Content
Hi,

> pytime.c:184: runtime error: value -1e+200 is outside the range of representable values of type 'long'

How did you get this warning?

> Shouldn't a range test based on TIME_T_MAX with an epsilon occur first?

Two lines after, the integer overflow is checked:

        *sec = (time_t)intpart;
        err = intpart - (double)*sec;
        if (err <= -1.0 || err >= 1.0) {
            error_time_t_overflow();
            return -1;
        }

And it works, example:

>>> import _testcapi
>>> _testcapi.pytime_object_to_time_t(-1e+200, 0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: timestamp out of range for platform time_t

(where 0 means _PyTime_ROUND_DOWN)
History
Date User Action Args
2014-03-16 20:38:57vstinnersetrecipients: + vstinner, Jeffrey.Walton
2014-03-16 20:38:57vstinnersetmessageid: <1395002337.27.0.843459132125.issue20941@psf.upfronthosting.co.za>
2014-03-16 20:38:57vstinnerlinkissue20941 messages
2014-03-16 20:38:56vstinnercreate