Skip to content

gh-159739: Release weak proxy operands on errors - #159968

Open
jelle-openai wants to merge 1 commit into
python:mainfrom
jelle-openai:jelle/codex/gh-159739-weakref-proxy-operands
Open

jelle-openai wants to merge 1 commit into
python:mainfrom
jelle-openai:jelle/codex/gh-159739-weakref-proxy-operands

Conversation

@jelle-openai

@jelle-openai jelle-openai commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Release weak proxy operands on errors. Binary, ternary, and comparison operations unwrap their operands in sequence. If a later operand is a dead weak proxy, they raise ReferenceError without dropping the strong references acquired for earlier operands, so those objects can stay alive after their last intended reference is gone.

Backport to 3.15 and 3.14.

@JelleZijlstra
JelleZijlstra marked this pull request as ready for review October 21, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant