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
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee=Noneclosed_at=<Date2018-05-30.17:53:49.619>created_at=<Date2018-04-06.18:02:45.599>labels= ['3.8', 'library', 'expert-asyncio']
title='AssertionError on await of Future returned by asyncio.wrap_future'updated_at=<Date2018-05-30.17:53:49.619>user='https://github.com/jhaydaman'
When the concurrent Future wrapped by asyncio.wrap_future has set_result or set_exception called multiple times, I get the following traceback:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/asyncio/events.py", line 145, in _runself._callback(*self._args)
File "/usr/local/lib/python3.6/asyncio/futures.py", line 399, in _set_state
File "/usr/local/lib/python3.6/asyncio/futures.py", line 369, in _copy_future_stateassertnot dest.done()
The documentation says that set_result and set_exception are only meant for Executors, so, arguably using them outside of that context would fall into undocumented behavior rather than a bug. But it still seems like it should be the second set_result that raises something like InvalidStateError. Alternatively, this can be avoided if _copy_future_state checks for done in addition to cancellation. What should happen here?