Skip to content

[3.15] gh-153291: Fix data race in readline.get_completer() and get_pre_input_hook() (gh-153362) - #154418

Merged
nascheme merged 1 commit into
python:3.15from
miss-islington:backport-90b6a79-3.15
Jul 22, 2026
Merged

[3.15] gh-153291: Fix data race in readline.get_completer() and get_pre_input_hook() (gh-153362)#154418
nascheme merged 1 commit into
python:3.15from
miss-islington:backport-90b6a79-3.15

Conversation

@miss-islington

@miss-islingtonmiss-islington commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

The setters store these hooks while holding the module critical section
(via set_hook's Py_XSETREF), but the getters read and Py_NewRef the same
fields without it. Annotate both getters with @critical_section, matching
the other readline functions (gh-126895).
(cherry picked from commit 90b6a79)

Co-authored-by: Harjoth Khara harjoth.khara@gmail.com
Co-authored-by: Neil Schemenauer nas-github@arctrix.com

…e_input_hook() (pythongh-153362)
The setters store these hooks while holding the module critical section
(via set_hook's Py_XSETREF), but the getters read and Py_NewRef the same
fields without it. Annotate both getters with @critical_section, matching
the other readline functions (pythongh-126895).
(cherry picked from commit 90b6a79)
Co-authored-by: Harjoth Khara <harjoth.khara@gmail.com>
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
@nascheme
nascheme merged commit 7dca47d into python:3.15Jul 22, 2026
57 checks passed
@miss-islington
miss-islington deleted the backport-90b6a79-3.15 branch July 22, 2026 17:54
Sign up for freeto 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.

3 participants

@miss-islington@nascheme@harjothkhara