Skip to content

gh-135675: Document 10.16 vs 11.0 / 16.0 vs 26.0 behavior of platform.mac_ver() #136339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Doc/library/platform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,16 @@ macOS platform
Entries which cannot be determined are set to ``''``. All tuple entries are
strings.

.. note::

Where macOS has changed its versioning scheme, it reports the next
logical version assuming the old scheme to applications built with any
prior macOS SDK version unless a ``SYSTEM_VERSION_COMPAT=0`` environment
variable is set. On macOS 11.0, the ``release`` field if Python is built
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
variable is set. On macOS 11.0, the ``release`` field if Python is built
variable is set, or the application is rebuild with a matching SDK. On macOS 11.0, the ``release`` field if Python is built

with SDK < 11 is ``'10.16'`` and on macOS 26.0, it's ``'16.0'`` unless
Python was built with SDK >= 26.0.
Comment on lines +243 to +244
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion also allows simplifying the version detail.

Possibly:

On macOS 11 or later the compatibility version reported in the release field is 10.16, on macOS 26 or later it is 16.0.

This still isn't 100% correct. AFAIK a binary compiled with a 10.15 SDK will report the system version as 10.16 even on macOS 26.



iOS platform
------------

Expand Down
Loading