New submission from Jonathan Slenders <[email protected]>:
We have a snippet of code that runs perfectly fine using the
`SelectorEventLoop`, but crashes *sometimes* using the `ProactorEventLoop`.
The traceback is the following. The exception cannot be caught within the
asyncio application itself (e.g., it is not attached to any Future or
propagated in a coroutine). It probably propagates in `run_until_complete()`.
File "C:\Python38\lib\asyncio\proactor_events.py", line 768, in
_loop_self_reading
f.result() # may raise
File "C:\Python38\lib\asyncio\windows_events.py", line 808, in _poll
value = callback(transferred, key, ov)
File "C:\Python38\lib\asyncio\windows_events.py", line 457, in finish_recv
raise ConnectionResetError(*exc.args)
I can see that in `IocpProactor._poll`, `OSError` is caught and attached to the
future, but not `ConnectionResetError`. I would expect that
`ConnectionResetError` too will be attached to the future.
In order to reproduce, run the following snippet on Python 3.8:
from prompt_toolkit import prompt # pip install prompt_toolkit
while 1:
prompt('>')
Hold down the enter key, and it'll trigger quickly.
See also: https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1023
----------
components: asyncio
messages: 358140
nosy: Jonathan Slenders, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: ProactorEventLoop raises unhandled ConnectionResetError
versions: Python 3.8
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39010>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com