Skip to content

AsyncResolver not default when aiodns is installed. #2228

Closed
@elektito

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

  1. Install aiodns: pip install aiodns.
  2. Check if AsyncResolver is 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

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions