Message355449
Consider the following code:
import asyncio
q = asyncio.Queue()
async def main():
await asyncio.gather(q.put(1), q.get(1))
asyncio.run(main())
This code just hangs since run() creates a loop but queue is bound with another (default) event loop.
The error is confusing and hard-to-debug.
We should raise a warning at least for the case; start from DeprecationWarning and make the system stricter later.
asyncio/locks.py is also affected since it has first-class classes (classes that instantiated by a user directly without factories). |
|
Date |
User |
Action |
Args |
2019-10-27 07:08:05 | asvetlov | set | recipients:
+ asvetlov, yselivanov |
2019-10-27 07:08:05 | asvetlov | set | messageid: <1572160085.79.0.39835517746.issue38599@roundup.psfhosted.org> |
2019-10-27 07:08:05 | asvetlov | link | issue38599 messages |
2019-10-27 07:08:05 | asvetlov | create | |
|