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
'Unhandled exception in event loop' (WinError 995) #12049
Comments
Can you try to downgrade prompt toolkit to 2.x to see if this is the cause ? |
I did downgrade to prompt toolkit 2.0.10 and it worked. Thank you so much. |
Prompt_toolkit 3 (the library that allows IPython to have multi-line editing and syntactic coloration) was released just before IPython 7.10; it tries to play nicer with asyncio eventloop if you do some concurrent programming. We've done our best to make IPython compatible with prompt toolkit 3, but there are a couple of edge case we might not have though about. Everything should work fine with prompt_toolkit 2.x, and we'll try to figure out why you got the above error. With your current error it is hard to know where exactly this is coming from, but hopefully in the next few release we'll narrow down the reason. |
Any idea when this is going to be solved? |
When someone find the time to investigate why this happens and what the fix is; potentially someone with a windows machine as VM are particularly slow. Unfortunately all of the regular maintainer (aka mostly me), are doing this on their free time – which is rare. I also do not have a windows machine. If you find any clues, of sequences of actions that always trigger this that would help. |
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)
EDIT: you can just use EDIT2: Bug on bugs.python.org and description of what is causing this error (found by someone else): https://bugs.python.org/issue39010#msg362076 |
MrEightFive Thanks for your fix.. It seems to be working for me |
@MrEightFive Thank you, just implemented the change. It seems to be working just fine. |
@MrEightFive Looks like it works for Python 3.8.2 as well. |
Thanks @MrEightFive and @Carreau for your solutions, much appreciated, I had same issue. |
Same positive experience |
Same, thanks ! |
Encountering this too. @MrEightFive if you think you know what the fix is, maybe submit a pull request to CPython? 😉 |
@segevfiner Second, bug report for this already exists on bugs.python.org (see EDIT2 in my post above), under different title, but the reason for this bug is stated exactly as I have found out. So I guess not necessary to duplicate. Third, though my workaround works, I have no guarantee that it has no side effects (it has some dependencies as of how shutdown of event loop is implemented in that particular version of asyncio, and that might change). I ran CPython's asyncio tests (on 3.8.1), and they had passed, but I never investigated beyond that. It is better if someone actually working on asyncio and well versed in CPython code would verify it. |
@MrEightFive It's actually simpler then you think. Just submit a PR and sign a CLA, then wait for code review, etc. Like any other project in GitHub. Though CPython often doesn't seem to have enough people reviewing pull requests, so many are left hanging. Alternatively you can just post your suggested workaround on the Python bug tracker issue. Even if you are not sure, you can just say so in the PR/issue, raising your concerns about it. This often helps getting someone more familiar to look at the issue and verify the fix or offer a better/correct one. But it's just a suggestion, do it only if you really feel like it. |
Connected to here on Python bug tracker Issue39010 - ProactorEventLoop raises unhandled ConnectionResetError - msg366002 |
this error raised for also while using the promt_toolkit, but the solution : MrEightyFive works fantastic, saved a lot of time, thanks |
adding code to proactor_events.py (as MrEightFive suggested) didn't help but |
KyryloKaralyus' solution worked for me. One thing to note - I first accidentally ran (missing the 0 at the end) pip install --upgrade prompt-toolkit==2.0.1 and this caused the error to start occurring non-stop. I had to kill the terminal. |
That worked for me. |
Pull request was finally proposed for CPython: bpo-39010: Ignore error on cancelled future after end of loop. #20525 |
|
I am getting this exception with python 3.8.3, ipython 7.13.0, prompt_toolkit 3.0.5 |
The easier way is to copy the entire asyncio package into your project and modify it there, then rely on Python to shadow the entire module. Windows Store apps are very well protected. But I'm also following up on the CPython patch. |
worked for me too!! |
Thanks a ton, this worked for me: conda install prompt_toolkit=2.0.10 |
This helped me as well, thank you! |
Thank you so much, I finally have the above solution working on my device!! I tried doing the following but I would always get [Errno 13] Permission denied
|
This has been fixed in 3.9rc2 |
@imba-tjd Will it be back ported to older Python versions? (Or has it already?) |
from the python bugs, t looks like it has been backported on 3.8. |
I'm receiving the error even with 3.9rc2... |
This helped, thanks. |
I wonder if this is now fixed in Python 3.8.6 and 3.9. |
I got this issue with a clean install of Python 3.8.3 using Anaconda on Windows 10 and the workaround by @MrEightFive worked perfectly fine for me! |
pip install --upgrade prompt-toolkit==2.0.10 |
This (pretty much) worked for me on Windows 10, Anaconda Individual Edition 2020.11 . If you're a fellow Anaconda user, you may want to keep this update within the conda environment: Which worked for me. |
It comes up instantly after I execute an try-except-block, in other cases it is unpredictable Just wanna add the german error text, so this will be found by more users. (Windows 10 Pro, Version 2004) Unhandled exception in event loop: Exception [WinError 995] Der E/A-Vorgang wurde wegen eines Threadendes oder einer Anwendungsanforderung abgebrochen |
Sadly
did not fix the issue for me. |
@musm, you need to specify prompt_toolkit v2.
|
I'm on Anaconda 2020.11 doing
Is leading to massive conflicts:
|
Hi @musm, this is one of the downsides of using the full Anaconda distribution. There are so many modules that it can be difficult to resolve all of their dependencies simultaneously if you stray from the provided distribution. You might try Miniconda instead, which is Conda, but without the pre-installed modules. With it, you create environments to include just the modules you need for your project. I haven't tried this, but it's possible you may also be able to do this without having to uninstall Anaconda and install Miniconda instead. I.E. Create a new environment from scratch that includes only specific modules. Try it with a command like the following (edit the module names to include what you really need).
|
Thanks!It‘s really useful for me ,even in 2021! |
This appears to be fixed for me in Python 3.9.1 (at least) on Windows 10 |
yes it worked for me as well. thanks |
I think this is fixed in the latest prompt-tookit (currently 3.0.17).
|
Tried updating (3.0.29) and no change. |
I get the same error on Ubuntu, when using Jupyter console 6.4.4. It resolves if I downgrade prompt-toolkit to
Any idea how to get both IPython and Jupyter console to work? |
I started using ipython recently. Now I often get this message upon doing any action, even simple ones like defining variables:
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.
The text was updated successfully, but these errors were encountered: