GH-108390: Prevent non-local events being set with sys.monitoring.set_local_events()#108420
Merged
markshannon merged 8 commits intopython:mainfrom Sep 5, 2023
Merged
Conversation
sys.monitoring.set_local_events()sys.monitoring.set_local_events()
2 tasks
Member
Author
|
Also fixes #108470 |
Misc/NEWS.d/next/Core and Builtins/2023-08-13-17-18-22.gh-issue-108390.TkBccC.rst
Outdated
Show resolved
Hide resolved
chgnrdv
reviewed
Sep 1, 2023
chgnrdv
reviewed
Sep 1, 2023
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
iritkatriel
reviewed
Sep 4, 2023
iritkatriel
approved these changes
Sep 4, 2023
Contributor
|
Thanks @markshannon for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Contributor
|
Sorry, @markshannon, I could not cleanly backport this to |
markshannon
added a commit
to faster-cpython/cpython
that referenced
this pull request
Sep 5, 2023
…ing.set_local_events()` (pythonGH-108420)
markshannon
added a commit
to faster-cpython/cpython
that referenced
this pull request
Sep 5, 2023
…ing.set_local_events()` (pythonGH-108420)
|
markshannon
added a commit
to faster-cpython/cpython
that referenced
this pull request
Sep 5, 2023
…ing.set_local_events()` (pythonGH-108420)
|
GH-108899 is a backport of this pull request to the 3.12 branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PEP 669 refers to "local events" and implies strongly, if not explicitly stated, that only local events can be set locally.
But, the implementation allows non-local events, like
RAISE, to be set locally.This PR fixes that, which allows the crash reported in #108390 to be fixed as well.
Although a relatively large PR, as it will need backporting, it is really just splitting
_Py_Monitorsinto_Py_LocalMonitorsand_Py_GlobalMonitorsand fixing the resulting compiler errors and warnings.