Skip to content

gh-142662: Fix interpreter startup crash when codecs are not initialized yet - #161860

Open
sobolevn wants to merge 1 commit into
python:mainfrom
sobolevn:issue-142662
Open

sobolevn wants to merge 1 commit into
python:mainfrom
sobolevn:issue-142662

Conversation

@sobolevn

@sobolevn sobolevn commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

This is rather hard to test in the test suite, so I decided to skip the test for rather obvious change :)

Local testing, before:

» ./Programs/_freeze_module crash crash.py crash.h
Assertion failed: (interp->codecs.initialized), function _PyCodec_Lookup, file codecs.c, line 142.
[1]    26986 abort      ./Programs/_freeze_module crash crash.py crash.h

After:

» ./Programs/_freeze_module crash crash.py crash.h
Exception ignored in the internal traceback machinery:
SystemError: null argument to internal routine
SystemError: Codecs are not initialized

Notice that the first error SystemError: null argument to internal routine is unrelated and I will fix it separately.

@sobolevn

Copy link
Copy Markdown
Member Author

However, note that this does not fix the internal problem that ./Programs/_freeze_module crash crash.py crash.h calls uninitialized interpreter.

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

Labels

awaiting merge needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants