You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
closing async_generator_athrow on an async generator that suppresses GeneratorExit does not raise RuntimeError #117714
changed the title [-]closing async_generator_athrow on an async generator that suppresses exception does not raise RuntimError[/-][+]closing async_generator_athrow on an async generator that suppresses exception does not raise RuntimeError[/+]on Apr 10, 2024
it looks like async_gen_athrow_close just marks the async_generator_athrow as closed and returns None, instead it should call gen_throw with a GeneratorExit object and transform any return values into RuntimeError exceptions.
changed the title [-]closing async_generator_athrow on an async generator that suppresses exception does not raise RuntimeError[/-][+]closing async_generator_athrow on an async generator that suppresses GeneratorExit does not raise RuntimeError[/+]on Apr 10, 2024
Activity
[-]closing async_generator_athrow on an async generator that suppresses exception does not raise RuntimError[/-][+]closing async_generator_athrow on an async generator that suppresses exception does not raise RuntimeError[/+]graingert commentedon Apr 10, 2024
it looks like async_gen_athrow_close just marks the async_generator_athrow as closed and returns None, instead it should call gen_throw with a GeneratorExit object and transform any return values into RuntimeError exceptions.
cpython/Objects/genobject.c
Lines 2244 to 2249 in 6bc0b33
[-]closing async_generator_athrow on an async generator that suppresses exception does not raise RuntimeError[/-][+]closing async_generator_athrow on an async generator that suppresses GeneratorExit does not raise RuntimeError[/+]graingert commentedon Apr 10, 2024
this also applies to
async_generator_asend.close()graingert commentedon Apr 11, 2024
another example showing
aclose().close()doesn't finalize the generator:pythonGH-117714: replace athrow().close() and asend().close() stubs w…
pythonGH-117714: replace athrow().close() and asend().close() stubs w…
pythonGH-117714: replace athrow().close() and asend().close() stubs w…
pythonGH-117714: replace athrow().close() and asend().close() stubs w…
pythonGH-117714: replace athrow().close() and asend().close() stubs w…
GH-117714: implement athrow().close() and asend().close() using throw (…
pythonGH-117714: implement athrow().close() and asend().close() using…
pythonGH-117714: implement athrow().close() and asend().close() using…
fix(django): support async views and middleware under ASGI on Python …
Fix AsyncGenerator following CPython (GH-7777)