'Unhandled exception in event loop' (WinError 995)
See original GitHub issueI started using ipython recently. Now I often get this message upon doing any action, even simple ones like defining variables:
Unhandled exception in event loop:
File "c:\users\USER\appdata\local\programs\python\python38-32\lib\asyncio\proactor_events.py", line 768, in _loop_self_reading
f.result() # may raise
File "c:\users\USER\appdata\local\programs\python\python38-32\lib\asyncio\windows_events.py", line 808, in _poll
value = callback(transferred, key, ov)
File "c:\users\USER\appdata\local\programs\python\python38-32\lib\asyncio\windows_events.py", line 457, in finish_recv
raise ConnectionResetError(*exc.args)
Exception [WinError 995] The I/O operation has been aborted because of either a thread exit or an application request
Press ENTER to continue...
This message sometimes shows up, sometimes not, for the same command (Like xyz = “hello”). Have no idea what I did wrong. The normal interpreter doesn’t have this problem. Using 3.8 and installed ipython 7.10.2 through the cmd.
Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:55
- Comments:48 (10 by maintainers)
Top Results From Across the Web
Error in ipython console "Exception [WinError 995] The I/O ...
It seems to be a bug in the ipython prompt toolkit (version >= 3). Try doing this for your environment: conda install prompt-toolkit~=2.0....
Read more >IPython Unhandled exception in event loop on Windows ...
Unhandled exception in event loop : File "c:\users\USER\appdata\local\programs\python\python38-32\lib\asyncio\proactor_events.py", line 768, in ...
Read more >IPython Unhandled exception in event loop on Windows Platform
IPython Unhandled exception in event loop on Windows Platform ... in finish_recv raise ConnectionResetError(*exc.args) Exception [WinError 995] The I/O ...
Read more >Exception [WinError 995] 由于线程退出或应用程序请求的解决 ...
Unhandled exception in event loop : File "C:\Users\secsilm\Anaconda3\lib\asyncio\proactor_events.py", line 768, in _loop_self_reading f.result() ...
Read more >Crazy exceptions in event loop errors! - Python
args) Exception [WinError 995] The I/O operation has been aborted because of either a thread exit or an application request Press ENTER to ......
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
After some investigation, I think it is a bug in Windows platform implementation of Python’s asyncio:
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on Windows 10 Version 1809 (OS Build 17763.1039)
BaseProactorEventLoop._loop_self_reading
after line 768 the following code:766....try:
767........if f is not None:
768............f.result() # may raise
...........if self._stopping:
...............raise exceptions.CancelledError("Event loop is stopping")
769........f = self._proactor.recv(self._ssock, 4096)
EDIT: you can just use
if self._stopping: return
instead in this particular code context (should be a bit faster)EDIT2: Bug on bugs.python.org and description of what is causing this error (found by someone else): https://bugs.python.org/issue39010#msg362076
adding code to proactor_events.py (as MrEightFive suggested) didn’t help but
pip install --upgrade prompt-toolkit==2.0.10
did . Win10 Python38.