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 — Segmentation fault in __lazy_import__ with non-string fromlist item · Issue #158637 · python/cpython

Segmentation fault in __lazy_import__ with non-string fromlist item #158637

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
Segmentation fault in __lazy_import__ with non-string fromlist item#158637
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-lazy-importstype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

Description

@error-3317
error-3317
opened on Oct 3, 2026
Issue body actions

Crash report

Bug Details

__lazy_import__() segfaults when fromlist contains a non-string object.

PoC

__lazy_import__("os", fromlist=(123,))

Output

~$ python -X faulthandler -c '__lazy_import__("os", fromlist=(123,))'; echo "exit status: $?"
Fatal Python error: Segmentation fault

Current thread 0x00007fd2b9bd6740 [python] (most recent call first):
  File "<string>", line 1 in <module>

Current thread's C stack trace (most recent call first):
  Binary file "python", at _Py_DumpStack+0x30 [0x4f1dd0]
  Binary file "python" [0x59990b]
  Binary file "python" [0x59985e]
  Binary file "/lib/x86_64-linux-gnu/libc.so.6", at +0x3c050 [0x7fd2b990d050]
  Binary file "python" [0x1d98601]
  Binary file "python", at PyUnicode_FromFormat+0x60 [0x1a2e4e0]
  Binary file "python" [0x1b3efc5]
  Binary file "python" [0x491a67]
  Binary file "python" [0x4916bf]
  Binary file "python", at PyObject_Vectorcall+0x4c [0x1a15d64]
  Binary file "python", at _Py_VectorCallInstrumentation_StackRefSteal+0xca [0x1aa8e9a]
  Binary file "python" [0x1aaa666]
  Binary file "python" [0x1abf644]
  Binary file "python", at PyEval_EvalCode+0xa6 [0x1abf326]
  Binary file "python" [0x1aae98f]
  Binary file "python" [0x1aae7a9]
  Binary file "python" [0x1b7de90]
  Binary file "python", at Py_RunMain+0x58c [0x1b7dd8c]
  Binary file "python" [0x1b7d7dd]
  Binary file "python" [0x1b7d62c]
  Binary file "/lib/x86_64-linux-gnu/libc.so.6", at +0x2724a [0x7fd2b98f824a]
  Binary file "/lib/x86_64-linux-gnu/libc.so.6", at __libc_start_main+0x85 [0x7fd2b98f8305]
  Binary file "python", at _start+0x29 [0x1bf9b69]
Segmentation fault
exit status: 139

CPython versions tested on:

3.15

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

Python 3.15.0rc2 (main, Sep 29 2026, 15:02:39) [Clang 22.1.3 ]

Activity

  1. error-3317
    added
    type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
    on Oct 3, 2026
  2. picnixz
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    topic-lazy-imports
    on Oct 3, 2026
  3. StanFromIreland commented on Oct 3, 2026

    @StanFromIreland
    StanFromIreland
    on Oct 3, 2026
    Member
    More actions

    This was fixed in a6a63b6.

    >>> __lazy_import__("os", fromlist=(123,))
    Traceback (most recent call last):
      File "<python-input-0>", line 1, in <module>
        __lazy_import__("os", fromlist=(123,))
        ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
    TypeError: Item in ``from list'' must be str, not int

    Although the error message is a little odd.

  4. StanFromIreland
    closed this as a duplicateof Implement PEP 810 – Explicit lazy imports #142349 on Oct 3, 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-lazy-importstype-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

    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.