Asyncio example from docs causes "RuntimeError: Event loop is closed" on Python 3.8.5, 64bit Windows 10 Pro, works fine on Python 3.7.4 #1287
Labels
duplicate
This issue or pull request already exists
Checklist
master
.Describe the bug
I'm trying the Asyncio example from the docs "https://www.python-httpx.org/async/"
To reproduce
py -3.8 -m pip venv venv
venv\Scripts\activate
python -m pip install httpx
save the example to "example.py" and run it
python example.py
Expected behavior
Output:
<Response [200 OK]>
Actual behavior
Output is printed, then RuntimeError
(venv) C:\temp\aa2>python example.py
<Response [200 OK]>
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x000002C41F396040>
Traceback (most recent call last):
File "C:\Python38\lib\asyncio\proactor_events.py", line 116, in del
self.close()
File "C:\Python38\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "C:\Python38\lib\asyncio\base_events.py", line 719, in call_soon
self._check_closed()
File "C:\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Environment
Name: httpx
Version: 0.14.3
Summary: The next generation HTTP client.
Home-page: https://github.com/encode/httpx
Author: Tom Christie
Author-email: tom@tomchristie.com
License: BSD
Location: c:\temp\aa2\venv2\lib\site-packages
Requires: httpcore, sniffio, chardet, rfc3986, certifi
Required-by:
Async environment:
asyncio, not tried on trio, because this is the asyncio example
HTTP proxy: no
Custom certificates: no
Additional context
Error also happens when I try in PyCharm.
The text was updated successfully, but these errors were encountered: