Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upbpo-35409: Ignore GeneratorExit in async_gen_athrow_throw #14755
Conversation
…ynchronous generator Related issues and pull requests on cpython: - https://bugs.python.org/issue35409 - python/cpython#14755
This comment has been minimized.
This comment has been minimized.
Corresponding PR on pypy: https://bitbucket.org/pypy/pypy/pull-requests/655 |
Can you double check if regular generators have the same bahavior before we merge? |
This comment has been minimized.
This comment has been minimized.
Well, I don't think this behavior applies to regular generators. The closest thing I could think of is: >>> def gen():
... try:
... yield
... finally:
... yield
...
>>> g = gen()
>>> g.send(None)
>>> g.close() which produces: Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: generator ignored GeneratorExit Also note that the chunk of code added to |
This comment has been minimized.
This comment has been minimized.
Just pinging, as it turns out to be a blocking issue for the aiostream library :) |
This comment has been minimized.
This comment has been minimized.
Andrew, can you take a look at this too? |
This comment has been minimized.
This comment has been minimized.
Is it urgent? |
This comment has been minimized.
This comment has been minimized.
I guess since we missed the RC1 for this it's no longer urgent. But please look at this as soon as you can. I'd like to hear your opinion. |
This comment has been minimized.
This comment has been minimized.
Hi all, I'm just pinging again as I would really like to have this issue fixed :) |
This comment has been minimized.
This comment has been minimized.
LGTM |
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Nov 19, 2019
Sorry, I can't merge this PR. Reason: |
8e0de2a
into
python:master
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Nov 19, 2019
Thanks @vxgmichel for the PR |
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Nov 19, 2019
I'm having trouble backporting to |
…4755) Ignore `GeneratorExit` exceptions when throwing an exception into the `aclose` coroutine of an asynchronous generator. https://bugs.python.org/issue35409 (cherry picked from commit 8e0de2a) Co-authored-by: Vincent Michel <vxgmichel@gmail.com>
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Nov 19, 2019
GH-17257 is a backport of this pull request to the 3.7 branch. |
This comment has been minimized.
This comment has been minimized.
miss-islington
commented
Nov 19, 2019
Thanks @vxgmichel for the PR |
…4755) Ignore `GeneratorExit` exceptions when throwing an exception into the `aclose` coroutine of an asynchronous generator. https://bugs.python.org/issue35409 (cherry picked from commit 8e0de2a) Co-authored-by: Vincent Michel <vxgmichel@gmail.com>
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Nov 19, 2019
GH-17258 is a backport of this pull request to the 3.8 branch. |
This comment has been minimized.
This comment has been minimized.
Thanks! |
Ignore `GeneratorExit` exceptions when throwing an exception into the `aclose` coroutine of an asynchronous generator. https://bugs.python.org/issue35409 (cherry picked from commit 8e0de2a) Co-authored-by: Vincent Michel <vxgmichel@gmail.com>
Ignore `GeneratorExit` exceptions when throwing an exception into the `aclose` coroutine of an asynchronous generator. https://bugs.python.org/issue35409 (cherry picked from commit 8e0de2a) Co-authored-by: Vincent Michel <vxgmichel@gmail.com>
…4755) Ignore `GeneratorExit` exceptions when throwing an exception into the `aclose` coroutine of an asynchronous generator. https://bugs.python.org/issue35409
vxgmichel commentedJul 13, 2019
•
edited by miss-islington
Ignore
GeneratorExit
exceptions when throwing an exception into theaclose
coroutine of an asynchronous generator.https://bugs.python.org/issue35409
Automerge-Triggered-By: @asvetlov