This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Bogus usage of floatclock in timemodule
Type: compile error Stage:
Components: Build Versions: Python 3.5
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Link Mauve, python-dev, vstinner
Priority: normal Keywords:

Created on 2014-10-13 18:34 by Link Mauve, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
pyconfig.h Link Mauve, 2014-10-14 09:43
Messages (7)
msg229260 - (view) Author: (Link Mauve) Date: 2014-10-13 18:34
In Modules/timemodule.c, py_process_time() still uses floatclock() even when HAVE_CLOCK isn’t defined.
msg229280 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-10-14 08:38
What is your platform?

time.process_time() supports many functions:

 - GetProcessTimes() (Windows only)
 - clock_gettime(CLOCK_PROF)
 - clock_gettime(CLOCK_PROCESS_CPUTIME_ID)
 - getrusage(RUSAGE_SELF)
 - times()
 - clock()

On POSIX, clock() is always tried as a fallback. Does your platform support at least one of these functions?
msg229281 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-10-14 08:38
See also the PEP 418:
msg229283 - (view) Author: (Link Mauve) Date: 2014-10-14 09:29
I’m building against the Newlib libc, for the Wii, and it seems the issue leading to all of those functions not working is:
(.text.clock+0x18): undefined reference to `_times_r'

Threading is disabled, and reentrant functions as well, which could explain that.

But still, when pyconfig.h doesn’t define any HAVE_ macro to get the system time, I would expect py_process_time() to return None or something instead of failing to build.
msg229284 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-10-14 09:42
Please attach your pyconfig.h file.
msg269990 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-07-08 15:23
Sorry but the Wii console is not supported. You have to maintain your fork/patch.

Python 3 don't support platforms without clock().
msg269993 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-07-08 15:55
New changeset 1452520dfe7b by Victor Stinner in branch 'default':
Issue #22624: Python 3 requires clock() to build
Date User Action Args
2022-04-11 14:58:09adminsetgithub: 66814
2016-07-08 15:55:55python-devsetnosy: + python-dev
messages: + msg269993
2016-07-08 15:23:05vstinnersetstatus: open -> closed
resolution: wont fix
messages: + msg269990
2014-10-14 09:43:38Link Mauvesetfiles: + pyconfig.h
2014-10-14 09:42:13vstinnersetmessages: + msg229284
2014-10-14 09:29:33Link Mauvesetmessages: + msg229283
2014-10-14 08:38:27vstinnersetmessages: + msg229281
2014-10-14 08:38:03vstinnersetmessages: + msg229280
2014-10-14 00:01:53pitrousetnosy: + vstinner
2014-10-13 18:34:55Link Mauvecreate