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
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
Actually, I thought so too but... this is just normal cancellation semantics now that I think more about it. I guess cancellation is just hard in general...
Activity
A5rocks commentedon Sep 18, 2025
Hypothesis: this is due to cancellation being suppressed.
A5rocks commentedon Sep 18, 2025
Ok it is. I guess this is user error!! But such a footgun...
This prints
yes, this was cancelled...if and only if we drop theValueError:Zac-HD commentedon Sep 18, 2025
😱 it's #455 again, because of course it is 😱
A5rocks commentedon Sep 18, 2025
Actually, I thought so too but... this is just normal cancellation semantics now that I think more about it. I guess cancellation is just hard in general...
jakkdl commentedon Sep 19, 2025
I think I was doing the exact same thing and confusing myself when writing tests for
as_safe_channel. Cancellation is definitely tricky!