picnixz · GitHub

Crash report

What happened?

Python 3.14.0a6+ (heads/main:0e53038ea82, Mar 24 2025, 14:56:34) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class A:
...     def __anext__(self):
...         raise StopAsyncIteration
...
>>> anext(A(), "a")
Segmentation fault (core dumped)

There is no crash with anext(A()) or when directly calling __anext__(). Or when __anext__ is declared with async def, it's fine. Or when __anext__() doesn't raise, it's also fine.

NB: I haven't bisected the change but it might be related to what I wrote in 76ffaef .

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

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

No response

Linked PRs

Read the original on github.com ↗