Skip to content

Conversation

bwoodsend
Copy link

@bwoodsend bwoodsend commented Jul 6, 2025

The macOS version reported in /System/Library/CoreServices/SystemVersion.plist can vary depending on what version of the macOS SDK Python was built with. This discrepancy bleeds into the output of platform.mac_ver().

Closes #135675.


📚 Documentation preview 📚: https://cpython-previews--136339.org.readthedocs.build/

…ython#135675)

The macOS version reported in /System/Library/CoreServices/SystemVersion.plist
can vary depending on what version of the macOS SDK Python was built with. This
discrepancy bleeds into the output of platform.mac_ver().
@python-cla-bot
Copy link

python-cla-bot bot commented Jul 6, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

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

Comment on lines +243 to +244
with SDK < 11 is ``'10.16'`` and on macOS 26.0, it's ``'16.0'`` unless
Python was built with SDK >= 26.0.
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.

@bedevere-app
Copy link

bedevere-app bot commented Aug 25, 2025

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@malemburg
Copy link
Member

FWIW: I'll leave this to @ronaldoussoren to review and decide. I'm not a Mac expert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting changes docs Documentation in the Doc dir skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

platform.mac_ver() returns macOS version of 16.0 instead of 26.0 on Tahoe
3 participants