-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
anext(A(), default)
crashes when StopAsyncIteration
is raised by a synchronous __anext__
#131670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-crash
A hard crash of the interpreter, possibly with a core dump
Comments
This happens because Lines 1839 to 1842 in d16f455
Looks like simple » PYTHONFAULTHANDLER=1 ./python.exe ex.py
Traceback (most recent call last):
File "/Users/sobolev/Desktop/cpython/ex.py", line 5, in <module>
print(anext(A(), "a"))
~~~~~^^^^^^^^^^
File "/Users/sobolev/Desktop/cpython/ex.py", line 3, in __anext__
raise StopAsyncIteration
StopAsyncIteration |
And not just |
Yes, that's what I observed (note that I actually found this bug because it was a typo I made when creating tests for another PR...) |
sobolevn
added a commit
to sobolevn/cpython
that referenced
this issue
Mar 24, 2025
sobolevn
added a commit
that referenced
this issue
Mar 24, 2025
…#131682) Co-authored-by: Bénédikt Tran <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Mar 24, 2025
…raises (pythonGH-131682) (cherry picked from commit 929afd1) Co-authored-by: sobolevn <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Mar 24, 2025
…raises (pythonGH-131682) (cherry picked from commit 929afd1) Co-authored-by: sobolevn <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
This was referenced Mar 24, 2025
sobolevn
added a commit
that referenced
this issue
Mar 24, 2025
… raises (GH-131682) (#131687) gh-131670: Fix crash in `anext()` when `__anext__` is sync and raises (GH-131682) (cherry picked from commit 929afd1) Co-authored-by: sobolevn <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
Thanks for the quick fix Nikita! |
sobolevn
added a commit
that referenced
this issue
Mar 24, 2025
… raises (GH-131682) (#131686) gh-131670: Fix crash in `anext()` when `__anext__` is sync and raises (GH-131682) (cherry picked from commit 929afd1) Co-authored-by: sobolevn <[email protected]> Co-authored-by: Bénédikt Tran <[email protected]>
diegorusso
pushed a commit
to diegorusso/cpython
that referenced
this issue
Apr 1, 2025
…raises (python#131682) Co-authored-by: Bénédikt Tran <[email protected]>
seehwan
pushed a commit
to seehwan/cpython
that referenced
this issue
Apr 16, 2025
…raises (python#131682) Co-authored-by: Bénédikt Tran <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-crash
A hard crash of the interpreter, possibly with a core dump
Crash report
What happened?
There is no crash with
anext(A())
or when directly calling__anext__()
. Or when__anext__
is declared withasync 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
anext()
when__anext__
is sync and raises #131682anext()
when__anext__
is sync and raises (GH-131682) #131686anext()
when__anext__
is sync and raises (GH-131682) #131687The text was updated successfully, but these errors were encountered: