Python 3.8.2 breaks nest-asyncio
See original GitHub issueThis trivial demo works with CPython 3.8.1 and breaks with 3.8.2:
import asyncio
import nest_asyncio
nest_asyncio.apply()
async def f():
print("OK")
async def g():
loop = asyncio.get_event_loop()
loop.run_until_complete(f())
if __name__ == "__main__":
asyncio.run(g())
Works
- Linux x64, anaconda, nest_asyncio 1.2.2
- python=3.8.1=h357f687_2 (conda-forge)
Output: OK
Broken
- Linux x64, anaconda, nest_asyncio 1.2.2
- python=3.8.2=h9d8adfe_1_cpython (conda-forge)
Output: RuntimeError: This event loop is already running
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
nest-asyncio - PyPI
Introduction. By design asyncio does not allow its event loop to be nested. This presents a practical problem: When in an environment where...
Read more >asyncio: works in Python 3.10 but not in Python 3.8
A glimpse at the asyncio code showed that the Python versions differ a lot. However, the Semaphores can't be just broken in 3.8,...
Read more >Release notes — Anaconda documentation
Anaconda Navigator has been updated to v2.3.1. This installer uses python-3.9. This is the first release that provides a python-3.10 variant for anaconda ......
Read more >Python on Biowulf - NIH HPC
There are three distinct ways to run python code or applications on biowulf: ... cache likely were broken during the transition and will...
Read more >2020-May.txt - Python mailing list
... b/Doc/whatsnew/3.8.rst @@ -2234,3 +2234,8 @@ Notable changes in Python 3.8.2 Fixed a regression with the ``ignore`` callback of :func:`shutil.copytree`.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just wanted to say I had this issue as well on python 3.8.2 and adding this to my conftest.py worked:
Tested 1.3 vs Python 3.8.2; everything works for me. @gordonwatts pytest-asyncio tampers with the asyncio event loop. I use it too but I was very careful not to mix it with nest-asyncio, uvloop, etc.
Try adding to your conftest.py: