-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
[3.13] gh-130940: Remove PyConfig.use_system_logger #131129
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
Conversation
!buildbot iOS |
🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit 98b0415 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F131129%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
@@ -0,0 +1,4 @@ | |||
The ``PyConfig.use_system_logger`` attribute, introduced in Python 3.12.2, has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is for Python 3.13. Do you mean Python 3.13.2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 I did.
Misc/NEWS.d/next/Library/2025-03-12-11-53-32.gh-issue-130940.81K1Tg.rst
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@ned-deily Although @vstinner has approved this, I'm holding off merging until I get your signoff as a macOS/iOS platform delegate, because of the implications on iOS stdout logging. |
I’ll review it tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and all tests pass in the simulator. Thanks for taking this on.
|
|
Both CI failures appear to be unrelated. The Android test has passed on a re-run. |
Removes ``PyConfig.use_system_logger``, resolving an ABI incompatibility introduced in 3.13.2. Changes the default behavior of iOS to *always* direct stdout/stderr to the system log.
Pull request #127754 is a backport of #127592 to the 3.13 branch. However, this PR included a new attribute (
use_system_logger
) in PyConfig, which broke ABI compatibility on Apple platforms (macOS and iOS).This was not detected because ABI compatibility checks are only performed on Linux, and the inclusion of the flag was gated with
__APPLE__
preprocessor handling.On macOS, removing the flag is no problem - it's a new feature, but an entirely optional one that would only be enabled by someone that has built (or updated) an app that embeds Python 3.13.2.
However, on iOS, the behavior enabled by this flag is required on iOS so that the logs generated by the simulator can be observed at all. More generally, there's very little reason that you'd not want stdout and stderr routed to the system log - every BeeWare app, for example, includes std-nslog, which implements effectively the same behavior.
This PR:
use_system_logger
attribute from PyConfig.This is, strictly, a change of behavior for 3.13 on iOS, unless you view "the output of Python's stdout/stderr is now visible in the app logs" as a bug that is resolved by this PR. My inclination is that this is such a signficant quality of life for iOS developers that it warrants being treated as a bugfix/improvement - but I wanted to flag the change in the strictest interpretation.
In an upcoming PR, I'll rework the introduction of the flag on the 3.14 branch to use the new PyInitConfig API (avoiding the ABI incompatibility), making the default value "enabled" on iOS, and "disabled" on macOS.
PyConfig.use_system_logger
has changed ABI in a patch 3.13.1 -> 3.13.2 #130940📚 Documentation preview 📚: https://cpython-previews--131129.org.readthedocs.build/