Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ThePyOS_* hooks interact poorly with subinterpreters #104668

Closed
Assignees
brandtbucher
@brandtbucher

Description

@brandtbucher

PyOS_InputHook andPyOS_ReadlineFunctionPointer are globally-registeredinput hooks that have no way of recovering module-level state for the extensions that registered them. In practice, extensions likereadline andtkinter get around this by using global state, which obviously isn't subinterpreter-friendly.

What's more, extensions without advertised subinterpreter support (likereadline andtkinter) who register these hooks might find themselves called from within a subinterpreter (where their extension hasn't even been loaded). That's definitely a situation we want to avoid.

It seems like the best solution for 3.12 is to only call these hooks from the main interpreter, which makes the bad situation quite a bit better. If libraries really need better APIs that work per-interpreter and have ways to access module state, we can certainly add them later (but for now maybe we'll just cross our fingers and hope that nobody actually cares).

@ericsnowcurrently, how does this sound to you?

Linked PRs

Metadata

Metadata

Assignees

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp