Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8c8b4e0

Browse files
committed
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.
1 parent 42a526c commit 8c8b4e0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Lib/test/test_time.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,13 @@ def test_localtime_without_arg(self):
346346
def test_mktime(self):
347347
# Issue #1726687
348348
for t in (-2, -1, 0, 1):
349+
if sys.platform.startswith('aix') and t == -1:
350+
# Issue #11188, #19748: mktime() returns -1 on error. On Linux,
351+
# the tm_wday field is used as a sentinel () to detect if -1 is
352+
# really an error or a valid timestamp. On AIX, tm_wday is
353+
# unchanged even on success and so cannot be used as a
354+
# sentinel.
355+
continue
349356
try:
350357
tt = time.localtime(t)
351358
except (OverflowError, OSError):

0 commit comments

Comments
 (0)