Skip to content

test_invalid_idna fails with idna 3.11 #12027

@OldManYellsAtCloud

Description

@OldManYellsAtCloud

Describe the bug

Using idna version 3.10 the test_invalid_idna testcase succeeds.
Using idna version 3.11 the same testcase fails.

To Reproduce

  1. Install idna version 3.11
  2. Run aiohttp test: pytest -k test_invalid_idna
  3. The testcase fails.

Expected behavior

Successful test execution.

Logs/tracebacks

Attached in file `test_output_with_idna_3.11.log`

Python Version

$ python --version
3.14.2

aiohttp Version

$ python -m pip show aiohttp
3.13.3

multidict Version

$ python -m pip show multidict
6.7.1

propcache Version

$ python -m pip show propcache
0.4.1

yarl Version

$ python -m pip show yarl
1.22

OS

Yocto, built from a recent master branch

Related component

Client

Additional context

Using idna version 3.10 the same testcase succeeds.

Below is the output of the failing statement in the python interpreter.

With idna 3.11 (the unicode character is removed):

root@qemux86-64:/usr/lib/python3.14/site-packages# python3
Python 3.14.2 (main, Dec  5 2025, 16:49:16) [GCC 15.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from yarl import URL
>>> a = URL("http://\u2061owhefopw.com")
>>> print("%s" % repr(a))
URL('http://owhefopw.com')

With idna 3.10 (the unicode char throws an exception, as expected by the test):

root@qemux86-64:/usr/lib/python3-aiohttp/ptest# python3
Python 3.14.2 (main, Dec  5 2025, 16:49:16) [GCC 15.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from yarl import URL
>>> a = URL("http://\u2061owhefopw.com")
Traceback (most recent call last):
  File "/usr/lib/python3.14/site-packages/idna/core.py", line 357, in uts46_remap
    raise IndexError()
IndexError

During handling of the above exception, another exception occurred:
...

test_output_with_idna_3.11.log

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