GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Possible `NULL`-related `SystemError` when interpreter is not fully initialized · Issue #161863 · python/cpython

Possible NULL-related SystemError when interpreter is not fully initialized #161863

New issue
Copy link
New issue
Copy link
Open
Open
Possible NULL-related SystemError when interpreter is not fully initialized#161863
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-importlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@sobolevn
sobolevn
opened on Nov 12, 2026
Issue body actions

Code:

cpython/Python/import.c

Lines 3921 to 3922 in 9f38636

mod = PyObject_CallMethodObjArgs(IMPORTLIB(interp), find_and_load,
abs_name, IMPORT_FUNC(interp), NULL);

Here IMPORTLIB(interp) can be NULL under rare conditions:

cpython/Python/import.c

Lines 95 to 96 in 9f38636

#define IMPORTLIB(interp) \
(interp)->imports.importlib

For example, when interpreter is not yet fully initialized.

Output:

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

Refs #161860 where I first found this case.
Refs #142662 where the initial reproducer was found.

I guess we should raise a different SystemError here with the text that imports are not yet fully initialized.

My proposal is to make the error message better here: it should state the interpreter is not fully initialized.

And ideally we can fix the freeze command as well later.

Activity

  1. sobolevn
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    topic-importlib
    on Nov 12, 2026
  2. picnixz
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-importlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.