Skip to content

aiohttp cannot be used in python 3.14. #8476

@AraHaan

Description

@AraHaan

Describe the bug

This is because they have already removed typing.ByteString that is used inside of payload.py.

They suggest either replacing it with bytes | bytearray or collections.abc.Buffer. For use as an ABC, prefer Sequence or collections.abc.Buffer.

To Reproduce

Clone the CPython main branch and build, then install pip and aiohttp.

Next try to run some code that depends on the latest version of aiohttp.

Expected behavior

Everything to work as aiohttp would be prepared for the removal of typing.ByteString. Preparing it now before it becomes stable is a good idea as then it requires less work later.

Logs/tracebacks

Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "__init__.py", line 8, in <module>
  File "__init__.py", line 23, in <module>
  File "client.py", line 49, in <module>
  File "__init__.py", line 6, in <module>
  File "client.py", line 38, in <module>
  File "payload.py", line 10, in <module>
ImportError: cannot import name 'ByteString' from 'typing' (C:\Users\User\OneDrive\Desktop\DiscordBot\pcbuild\bin\lib.zip\typing.pyc)


### Python Version

```console
$ python --version
3.14.0a0

aiohttp Version

$ python -m pip show aiohttp
3.9.5

multidict Version

$ python -m pip show multidict
6.0.5

yarl Version

$ python -m pip show yarl
1.9.4

OS

Windows

Related component

Server, 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