Skip to content

Incompatible with aiodns 4.0.0 #226

@Julian-O

Description

@Julian-O

Describe the bug

Since last week, if I pip install aiohttp[speedups], I get aiodns 4.0.0 installed.

If I then run the client example from the README it fails. The root cause exception:

Traceback (most recent call last):
  File "[...]\.venv\Lib\site-packages\aiohttp\resolver.py", line 117, in resolve
    resp = await self._resolver.getaddrinfo(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
aiodns.error.DNSError: (11, 'Could not contact DNS servers')

This goes on to trigger other exceptions.

If I explicitly downgrade to aiodns version 3.6.1, it works fine.

I would hazard a guess it this is an issue with aiodns rather than aiohttp, given they just released a new version. I would hope it will be fixed shortly in a 4.0.1 release.

Despite this, I thought an issue ticket was warranted here for three reasons:

  • It might be the case that aiodns 4.0.0 has had an API change that requires a corresponding change in aiohttp.
  • This project may choose to change its dependency to aiodns<4.0.0 until the issue is resolved.
  • Some people have dependencies on aiohttp and know nothing about aiodns and are going to look here for the resolution.

To Reproduce

  1. Install the latest aiohttp[speedups].
  2. Run 'pip freeze' Note that aiodns 4.0.0 is installed.
  3. Create a file, and enter the client example from the Readme.
  4. Run it, and note there is a DNS error.
  5. pip uninstall aiodns
  6. pip install aiodns<4.0.0
  7. Run the program again and notice it succeeds.

Expected behavior

.

Logs/tracebacks

.

Python Version

$ python --version
Python 3.12.10

(Also in Python 3.13)

aiohttp Version

$ python -m pip show aiohttp
Name: aiohttp
Version: 3.13.3
Summary: Async http client/server framework (asyncio)
Home-page: https://github.com/aio-libs/aiohttp
Author:
Author-email:
License: Apache-2.0 AND MIT
Location: [...]\.venv\Lib\site-packages
Requires: aiohappyeyeballs, aiosignal, attrs, frozenlist, multidict, propcache, yarl
Required-by: freedictionaryapi

multidict Version

$ python -m pip show multidict
Name: multidict
Version: 6.7.0
Summary: multidict implementation
Home-page: https://github.com/aio-libs/multidict
Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache License 2.0
Location: [...]\.venv\Lib\site-packages
Requires:
Required-by: aiohttp, yarl

propcache Version

$ python -m pip show propcache
Name: propcache
Version: 0.4.1
Summary: Accelerated property cache
Home-page: https://github.com/aio-libs/propcache

Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache-2.0
Location: [...]\.venv\Lib\site-packages
Requires:
Required-by: aiohttp, yarl

yarl Version

$ python -m pip show yarl
Name: yarl
Version: 1.22.0
Summary: Yet another URL library
Home-page: https://github.com/aio-libs/yarl
Author: Andrew Svetlov
Author-email: andrew.svetlov@gmail.com
License: Apache-2.0
Location: [...]\.venv\Lib\site-packages
Requires: idna, multidict, propcache
Required-by: aiohttp

OS

Windows 11

Related component

Client

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct

Metadata

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