saghul / aiodns

Simple DNS resolver for asyncio

Home Page:https://pypi.python.org/pypi/aiodns

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Let DNSError inherit OSError to match with stdlib behavior

achimnol opened this issue · comments

Both socket.getaddrinfo and asyncio.BaseEventLoop.getaddrinfo raises OSError when a DNS lookup fails.
It would be more consistent if aiodns.error.DNSError is also an instance of OSError, setting errno and stringified error message as the current implementation does.

I don't think that's a good idea. The returned errors don't necessarily match errno.