AsyncResolver not default when aiodns is installed. #2228
Closed
Description
Long story short
The docs say the AsyncResolver is the default resolver used when aiodns is installed but this is not really the case.
Here's what current stable docs say:
Changed in version 1.0: The resolver is aiohttp.AsyncResolver now if aiodns is installed.
Expected behaviour
AsyncResolver being the default resolver when aiodns is installed.
Actual behaviour
ThreadedResolver is used.
Steps to reproduce
- Install
aiodns:pip install aiodns. - Check if
AsyncResolveris default:
>>> aiohttp.resolver.DefaultResolver == aiohttp.resolver.AsyncResolver
False
>>> aiohttp.resolver.DefaultResolver == aiohttp.resolver.ThreadedResolver
True
Your environment
I'm using aiohttp version 2.2.3 with Python 3.5.2 on Ubuntu 16.04.3.
More observations
In /aiohttp/resolver.py we can clearly see this line:
aiodns_default = False
And then later on:
DefaultResolver = AsyncResolver if aiodns_default else ThreadedResolver