Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-157384: Refuse inittab names in PyImport_CreateModuleFromInitfunc() - #157388

Open
itamaro wants to merge 1 commit into
python:mainfrom
itamaro:gh-116146-initfunc-refuse-inittab
Open

gh-157384: Refuse inittab names in PyImport_CreateModuleFromInitfunc()#157388
itamaro wants to merge 1 commit into
python:mainfrom
itamaro:gh-116146-initfunc-refuse-inittab

Conversation

@itamaro

@itamaro itamaro commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Modules created by PyImport_CreateModuleFromInitfunc() share the extensions cache and sys.modules with built-in modules. Passing a spec whose name is registered in PyImport_Inittab either silently ignored the init function (for an already loaded single-phase builtin, or for "sys" and "builtins") or replaced the built-in module in sys.modules (for a multi-phase builtin). Raise ImportError instead.

AI assisted with Claude Fable 5.1

…tfunc()

Modules created by PyImport_CreateModuleFromInitfunc() share the
extensions cache and sys.modules with built-in modules.  Passing a
spec whose name is registered in PyImport_Inittab either silently
ignored the init function (for an already loaded single-phase builtin,
or for "sys" and "builtins") or replaced the built-in module in
sys.modules (for a multi-phase builtin).  Raise ImportError instead.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HoZE3WdRWQshvinfBZ137N
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34530618 | 📁 Comparing a0de16a against main (2cd6d4b)

  🔍 Preview build  

2 files changed
± c-api/import.html
± whatsnew/changelog.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review needs backport to 3.15 pre-release feature fixes, bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant