wait_for
eats cancelled error if the future is already complete
#107547
Labels
pending
The issue will be closed if no feedback is provided
topic-asyncio
type-bug
An unexpected behavior, bug, or error
Bug report
If the future
asyncio.wait_for
is waiting on has already completed, and the task runningwait_for
gets cancelled,wait_for
will eat theasyncio.CancelledError
, and carry on as if nothing is happening.Checklist
A clear and concise description of the bug
Notably, if you remove the
await task
line, the cancelled error gets raised.Note that this may have been fixed in the following PR, that deleted the highlighted (I think problematic but I could be wrong) 3 lines of code:
https://github.com/python/cpython/pull/98518/files#diff-429f4ed1e0f89ea2c92e2a8e8548ea8ae1a3d528979554fbfa4c38329e951529L470-L472
But, I couldn't verify this as I don't think it got into 3.11.4, so I can't really run with it.
Your environment
The text was updated successfully, but these errors were encountered: