[New-bugs-announce] [issue34373] test_time errors on AIX
Michael Felt
report at bugs.python.org
Fri Aug 10 12:15:51 EDT 2018
New submission from Michael Felt <aixtools at felt.demon.nl>:
32-bit:
======================================================================
ERROR: test_mktime (test.test_time.TimeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/data/prj/python/src/python3-3.7.0/Lib/test/test_time.py", line 446, in test_mktime
self.assertEqual(time.mktime(tt), t)
OverflowError: mktime argument out of range
======================================================================
FAIL: test_pthread_getcpuclockid (test.test_time.TimeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/data/prj/python/src/python3-3.7.0/Lib/test/test_time.py", line 129, in test_pthread_getcpuclockid
self.assertNotEqual(clk_id, time.CLOCK_THREAD_CPUTIME_ID)
AssertionError: 12 == 12
----------------------------------------------------------------------
64-bit:
======================================================================
ERROR: test_mktime (test.test_time.TimeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/lib/python3.7/test/test_time.py", line 446, in test_mktime
self.assertEqual(time.mktime(tt), t)
OverflowError: mktime argument out of range
======================================================================
ERROR: test_pthread_getcpuclockid (test.test_time.TimeTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/lib/python3.7/test/test_time.py", line 130, in test_pthread_getcpuclockid
t1 = time.clock_gettime(clk_id)
OverflowError: signed integer is greater than maximum
The test_mktime failed because
time.mktime(time.localtime(-2)) -- actually any negative value in localtime - fails
The patch in the file Modules/timemodule.c fixes this.
The test_pthread_getcpuclockid is a bit more complex as the result is different
depending on 32 or 64-bit mode.
In 32-bit mode AIX always responds with the constant CLOCK_THREAD_CPUTIME_ID.
The patch in Lib/test/test_time.py makes the test aware of this.
In AIX clockid_t is actually long long. However, changing the type to parse to "L"
broke many other things. It seems to work as a long ("l") when the ABI is 64-bit.
See additional change in Modules/timemodule.c
static PyObject *
time_clock_gettime
Finally,
added some (additional) range checking for
_PyTime_localtime for AIX. Not having this complicated testing for above.
----------
components: Interpreter Core, Tests
messages: 323372
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: test_time errors on AIX
versions: Python 3.7, Python 3.8
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34373>
_______________________________________
More information about the New-bugs-announce
mailing list