Skip to content

[3.12] gh-122208: Don't delivery PyDict_EVENT_ADDED until it can't fail #122327

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

Merged
merged 2 commits into from
Jul 30, 2024

Conversation

DinoV
Copy link
Contributor

@DinoV DinoV commented Jul 26, 2024

Currently PyDict_EVENT_ADDED can be delivered when the insert is going to fail due to an OOM. This means the listener has no capability of knowing the true state of the dictionary if it fails.

This modifies the events to be delivaered before the change has happened but only after any underlying necessary allocations have occurred.

Backported from main: #122207

@DinoV DinoV marked this pull request as ready for review July 26, 2024 22:00
@DinoV DinoV requested a review from carljm July 27, 2024 00:05
@DinoV DinoV merged commit c8f5ca6 into python:3.12 Jul 30, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants