python / python/cpython

Assertion crash in `code_returns_only_none`

Open
#139,778 2 comments 0 reactions 1 assignee View on GitHub

@efimov-mikhail is already working on this.

Since Oct 16, 2025.

3.14 3.15 extension-modules topic-subinterpreters type-crash
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Crash report

What happened?

There is incorrect assertion in code_returns_only_none function from Objects/codeobject.c:

-> % cat subinterpreteres_assert.py     
from concurrent import interpreters

interp = interpreters.create()
interp.exec("""while True: pass""")

-> % ./python subinterpreteres_assert.py
python: Objects/codeobject.c:2132: code_returns_only_none: Assertion `IS_RAISE_OPCODE(final.op.code)' failed.
[1]    1341262 IOT instruction  ./python subinterpreteres_assert.py

I've already have a PR which fixes it.

CPython versions tested on:

CPython main branch, 3.14

Operating systems tested on:

No response

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

No response

Linked PRs
  • gh-139779

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.