Alexander Belopolsky <[email protected]> added the comment:
I wonder: with year bounds being checked in gettmarg() and mktime accepting
arbitrary values for the rest of the tm structure members (at least it appears
to on my Mac), is it possible trigger "mktime argument out of range"?
If it is possible, then a unit test should be added for such case. Note that
the issue2736 patch contains a typo that assures that overflow is never
reported, but the unit test presented here does not catch that bug:
"""
+ buf.tm_wday = -1;
tt = mktime(&buf);
- if (tt == (time_t)(-1)) {
+ if (tt == (time_t)(-1) && buf.tm_wday == 1) {
PyErr_SetString(PyExc_OverflowError,
"mktime argument out of range");
"""
(Note missing '-' in buf.tm_wday == 1 check. See issue2736.)
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue1726687>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com