[Python-checkins] cpython: Issue #11188, #19748: mktime() returns -1 on error. On Linux, the tm_wday field

victor.stinner python-checkins at python.org
Fri Feb 21 23:55:00 CET 2014


http://hg.python.org/cpython/rev/00e94e454813
changeset:   89319:00e94e454813
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri Feb 21 23:54:32 2014 +0100
summary:
  Issue #11188, #19748: mktime() returns -1 on error. On Linux, the tm_wday field
is used as a sentinel () to detect if -1 is really an error or a valid
timestamp. On AIX, tm_wday is unchanged even on success and so cannot be used
as a sentinel.

files:
  Lib/test/test_time.py |  7 +++++++
  1 files changed, 7 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -346,6 +346,13 @@
     def test_mktime(self):
         # Issue #1726687
         for t in (-2, -1, 0, 1):
+            if sys.platform.startswith('aix') and t == -1:
+                # Issue #11188, #19748: mktime() returns -1 on error. On Linux,
+                # the tm_wday field is used as a sentinel () to detect if -1 is
+                # really an error or a valid timestamp. On AIX, tm_wday is
+                # unchanged even on success and so cannot be used as a
+                # sentinel.
+                continue
             try:
                 tt = time.localtime(t)
             except (OverflowError, OSError):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list