New submission from Michael Felt <[email protected]>:
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 <[email protected]>
<https://bugs.python.org/issue34373>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com