-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
'RuntimeError: Event loop is closed' when running under Windows #9
Comments
Hmm, very odd. Can you try it on a newer version of 3.9? or on 3.10? |
Sure! Tested on 3.10.5 amd64 just now. Otherwise, same environment as before. This time I had a yaml config pointing to GHE (earlier test was github.com), but as before, the digest was written just fine, so this exception happens when the app is terminating.
|
This seems to be a known problem that is fixed in 3.10.6. |
Confirming that it doesn’t reproduce with Python 3.10.6. Adding something like…
… after the module imports, should silence it on earlier versions. |
I've released this as 0.13.1. |
This issue still happens on the SelectorEventLoop (enable ResourceWarnings) , it's just hidden by default |
|
you only need to ignore the runtime error rather than switching over to the SelectorEventLoop: import sys
def unraisablehook(unraisable, /, _old_hook=sys.unraisablehook):
if unraisable.err_msg == "RuntimeError: Event loop is closed" and isinstance(
unraisable.object, _ProactorBasePipeTransport
):
return
return _old_hook(unraisable)
sys.unraisablehook = unraisablehook (more people should use the ProactorEventLoop!) |
@graingert I appreciate the advice, but am more comfortable with switching the loop than suppressing the message, and this will all be unneeded eventually anyway. Thanks all for your help! |
@graingert That's a good comment! 👀 This is dark arts. Is it documented? Might be worth a blog post... Interesting. |
|
When running dinghy under windows I'm getting an 'Event loop is closed' error from the asyncio lib, even though the output file is created without issues.
The exact same command runs fine under Ubuntu, without exceptions - same repository, github token, dinghy version; error only happens on windows.
Note: the digest.html file was generated fine, so the exception thrown might be a minor issue related to resource cleanup.
Error log
The text was updated successfully, but these errors were encountered: