question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NotImplementedError on Win10 x64 OS

See original GitHub issue

Env

Win10 19.09 x64 Python 3.8.0

Code

import aiodns
import asyncio

async def query_a(name):
    resolver = aiodns.DNSResolver()
    return await resolver.query(name, "A")

if __name__ == '__main__':
    res = asyncio.run(query_a('qq.com'), debug=True)
    pass

Error

Connected to pydev debugger (build 193.5662.61)
From cffi callback <function _sock_state_cb at 0x000001C25B3C3430>:
Traceback (most recent call last):
  File "C:\Users\test\.virtualenvs\OneForAll-qYrK1GZO\lib\site-packages\pycares\__init__.py", line 91, in _sock_state_cb
    sock_state_cb(socket_fd, readable, writable)
  File "C:\Users\test\.virtualenvs\OneForAll-qYrK1GZO\lib\site-packages\aiodns\__init__.py", line 104, in _sock_state_cb
    self.loop.add_reader(fd, self._handle_event, fd, READ)
  File "C:\Program Files\Python38\Lib\asyncio\events.py", line 501, in add_reader
    raise NotImplementedError
NotImplementedError

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
Pavkazzzcommented, Jan 2, 2020

Add asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) in top of file couse python3.8 add Proactor loop in asyncio and broke compatability

2reactions
Pavkazzzcommented, Jan 3, 2020

So add it explicitly

import aiodns
import asyncio

asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

async def query_a(name):
    resolver = aiodns.DNSResolver()
    return await resolver.query(name, "A")

if __name__ == '__main__':
    res = asyncio.run(query_a('qq.com'))
    
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why am I getting NotImplementedError with async and await ...
I have this code: import os import time import asyncio async ...
Read more >
Windows 10 deployments fail with Microsoft Deployment ...
Please ensure that you have set an active partition on the boot disk before installing the operating system. Not implemented (Error: ...
Read more >
How to fix Outlook Error “Not Implemented”
There are several reasons why an Outlook “Not Implemented” error message may pop-up on your Windows 10 system. These are:.
Read more >
What Is a 501 Not Implemented Error (and How to Fix It)
A “501 Not Implemented” error occurs when a website you visit ... the “501 Not Implemented” error on several devices and operating systems....
Read more >
winreg — Windows registry access — Python 3.11.1 ...
On unsupported Windows versions, NotImplementedError is raised. ... Disables registry reflection for 32-bit processes running on a 64-bit operating system.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found