Closed oyarsa closed 1 year ago
Having the same problem on windows. So the workaround would be to run this under WSL.
Same problem in CPython3.9 on windows10.
Exactly the same problem on Python 3.9.4 on Windows 10 using the example program. Any suggestions?
I'm having the same issue.
Still got problem on Windows 10 with python3.9.5 and Windows 11 with python 3.10
c-ares, what is used underneath, requires a readyness style API, which is not supported on Windows unless you are using a SelectorEventLoop implementation: https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.SelectorEventLoop
Okay, thanks. By the way, I made an improvement to let other users know about this issue, and merge it if you think it's good. #105
In user code, it can be solved by adding
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
Maybe it should be part of the example?
Oh that's nice! When did they add to Python?
Happy to take a PR if you're up for it!
WindowsSelectorEventLoopPolicy
was added in 3.7
In 3.8 the default event loop for windows was changed to ProactorEventLoop
. At which point this became necessary.
Seems this was already discussed in #78
What does this mean....
File "C:\Users\RAZEER\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\resolver.py", line 95, in __init__
self._resolver = aiodns.DNSResolver(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\RAZEER\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiodns\__init__.py", line 60, in __init__
raise RuntimeError(
RuntimeError: aiodns needs a SelectorEventLoop on Windows. See more: https://github.com/saghul/aiodns/issues/86
What does this mean....
File "C:\Users\RAZEER\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\resolver.py", line 95, in __init__ self._resolver = aiodns.DNSResolver(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\RAZEER\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiodns\__init__.py", line 60, in __init__ raise RuntimeError( RuntimeError: aiodns needs a SelectorEventLoop on Windows. See more: https://github.com/saghul/aiodns/issues/86
Did you read this thread? Or the README?
What does this mean....
File "C:\Users\RAZEER\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiohttp\resolver.py", line 95, in __init__ self._resolver = aiodns.DNSResolver(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\RAZEER\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiodns\__init__.py", line 60, in __init__ raise RuntimeError( RuntimeError: aiodns needs a SelectorEventLoop on Windows. See more: https://github.com/saghul/aiodns/issues/86
Did you read this thread? Or the README?
Fixed thank you!
I tried running the example code on the README, and got this error:
The program hung after that. After interrupting it, this is the traceback:
This is on Windows 10 build 2004 with Python 3.8.5 and aiodns 2.0.0.