-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
window10 ProactorEventLoop does't not exit normally when task has finished #3359
Comments
GitMate.io thinks the contributor most likely able to help you is @asvetlov. Possibly related issues are #376 (ProactorEventLoop hangs ), #1559 (Lingering close doesn't terminate before timeout), #2038 (add_route does not allow **kwargs), #3075 (trust_env doesn't works), and #2309 (WebSocketResponse does not throw/close when connection is abruptly cut). |
Now try to run the same code on python 3.7.1. Unbelievably, it seem to run normally. Maybe it's a python bug! |
python 3.6.5 also works! |
I think it's a bug! |
Several proactor problems were fixed in 3.6 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
Long story short
Expected behaviour
`# coding:utf-8
import aiohttp
import asyncio
async def fetch(session, url):
async with session.get(url) as response:
return await response.text()
async def main():
async with aiohttp.ClientSession() as session:
html = await fetch(session, 'http://python.org')
print(html)
loop = asyncio.ProactorEventLoop()
asyncio.set_event_loop(loop)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())`
It exits normalley; However, when I use SelectorEventLoop, it works!
Actual behaviour
In face ,the program does't not exit; When I write result to a file, the content is not written to file;
It does't exit; when I attempt to close the loop, Error happen;
Exception ignored in: <bound method _ProactorBasePipeTransport.__del__ of <_ProactorSocketTransport closing fd=836 read=<_OverlappedFuture cancelled>>> Traceback (most recent call last): File "d:\software\programe\python35\Lib\asyncio\proactor_events.py", line 96, in __del__ self.close() File "d:\software\programe\python35\Lib\asyncio\proactor_events.py", line 84, in close self._loop.call_soon(self._call_connection_lost, None) File "d:\software\programe\python35\Lib\asyncio\base_events.py", line 572, in call_soon self._check_closed() File "d:\software\programe\python35\Lib\asyncio\base_events.py", line 357, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed Exception ignored in: <bound method _ProactorBasePipeTransport.__del__ of <_ProactorSocketTransport closing fd=876 read=<_OverlappedFuture cancelled>>> Traceback (most recent call last): File "d:\software\programe\python35\Lib\asyncio\proactor_events.py", line 96, in __del__ self.close() File "d:\software\programe\python35\Lib\asyncio\proactor_events.py", line 84, in close self._loop.call_soon(self._call_connection_lost, None) File "d:\software\programe\python35\Lib\asyncio\base_events.py", line 572, in call_soon self._check_closed() File "d:\software\programe\python35\Lib\asyncio\base_events.py", line 357, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed
Steps to reproduce
run the code
`# coding:utf-8
import aiohttp
import asyncio
async def fetch(session, url):
async with session.get(url) as response:
return await response.text()
async def main():
async with aiohttp.ClientSession() as session:
html = await fetch(session, 'http://python.org')
print(html)
loop = asyncio.ProactorEventLoop()
asyncio.set_event_loop(loop)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()`
Your environment
window10 + python 3.5.3
The text was updated successfully, but these errors were encountered: