Author asvetlov
Recipients asvetlov, yselivanov
Date 2019-10-27.07:08:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1572160085.79.0.39835517746.issue38599@roundup.psfhosted.org>
In-reply-to
Content
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).
History
Date User Action Args
2019-10-27 07:08:05asvetlovsetrecipients: + asvetlov, yselivanov
2019-10-27 07:08:05asvetlovsetmessageid: <1572160085.79.0.39835517746.issue38599@roundup.psfhosted.org>
2019-10-27 07:08:05asvetlovlinkissue38599 messages
2019-10-27 07:08:05asvetlovcreate