classification
Title: thread_time not available on python.org OS X builds
Type: behavior Stage: resolved
Components: Build Versions:
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: John Belmonte, ned.deily
Priority: normal Keywords:

Created on 2021-03-02 12:40 by John Belmonte, last changed 2021-03-04 02:33 by ned.deily. This issue is now closed.

Messages (2)
msg387925 - (view) Author: John Belmonte (John Belmonte) Date: 2021-03-02 12:40
time.thread_time is supposed to be available on OS X 10.12 and newer.

Yet it's reported to raise ImportError on macOS Big Sur (11.2.1) on Python 3.9.2 (python.org download).  (Reported by Quentin Pradet.)

It is available in other OS X Python builds, such as published by Home Brew.  (I confirm it's available on macOS 10.13, Python 3.7.7.)
msg388069 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2021-03-04 02:33
The reason time.thread_time() and several other functions in other modules that all depend on features in newer versions of macOS were not available in python.org macOS binaries because the installers are meant to support a range of operating system releases (rather than just one operating system version as with most other distributors) and, up until recently, the only supported way to do that was to build the binaries on the oldest supported system. Thus most python.org installers in recent years were built on macOS 10.9 where time.thread_time() does not exist. As of Python 3.9.1, with the addition of support for macOS 11 and Apple Silicon Macs, support for "weak-linking" was also added meaning that it is now possible to build Python 3.9.1+ on, say, macOS 11 and have it work without crashing on older systems. Currently, we only test back as far as 10.9. This feature is in the 10.9+ "universal2" variants available for 3.9.1+ releases and for 3.10 pre-releases.

https://docs.python.org/3/whatsnew/3.9.html#notable-changes-in-python-3-9-1
History
Date User Action Args
2021-03-04 02:33:03ned.deilysetstatus: open -> closed

nosy: + ned.deily
messages: + msg388069

resolution: out of date
stage: resolved
2021-03-02 12:40:42John Belmontecreate