-
-
Notifications
You must be signed in to change notification settings - Fork 368
Closed as not planned
Description
async def test8() -> None:
@trio.as_safe_channel
async def agen():
await chan.aclose()
raise ValueError()
yield
async with agen() as chan:
async for _ in chan:
pass
This sometimes raises this:
Traceback (most recent call last):
File "C:\Users\A5rocks\Documents\trio\repro.py", line 124, in <module>
trio.run(test8)
~~~~~~~~^^^^^^^
File "C:\Users\A5rocks\Documents\trio\src\trio\_core\_run.py", line 2547, in run
raise runner.main_task_outcome.error
File "C:\Users\A5rocks\Documents\trio\repro.py", line 121, in test8
async for _ in chan:
pass
File "C:\Users\A5rocks\Documents\trio\src\trio\_abc.py", line 689, in __anext__
return await self.receive()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\A5rocks\Documents\trio\src\trio\_channel.py", line 477, in receive
return await self._recv_chan.receive()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\A5rocks\Documents\trio\src\trio\_channel.py", line 385, in receive
return await trio.lowlevel.wait_task_rescheduled(abort_fn) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\A5rocks\Documents\trio\src\trio\_core\_traps.py", line 208, in wait_task_rescheduled
return (await _async_yield(WaitTaskRescheduled(abort_func))).unwrap()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\A5rocks\Documents\trio\.venv\Lib\site-packages\outcome\_impl.py", line 213, in unwrap
raise captured_error
trio.ClosedResourceError
Notice no ValueError
! Spun off of #3331
Metadata
Metadata
Assignees
Labels
No labels