-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
import aiohttp fails on 3.14 when zstd is not installed #11603
Copy link
Copy link
Closed
Labels
Description
Describe the bug
import aiohttp fails on 3.14 when Cpython is built without zstd support. The CPython docs neglect to mention that compression.zstd is optional. For example:
import aiohttp
.tox/test/lib/python3.14/site-packages/aiohttp/__init__.py:6: in <module>
from .client import (
.tox/test/lib/python3.14/site-packages/aiohttp/client.py:40: in <module>
from . import hdrs, http, payload
.tox/test/lib/python3.14/site-packages/aiohttp/http.py:7: in <module>
from .http_parser import (
.tox/test/lib/python3.14/site-packages/aiohttp/http_parser.py:29: in <module>
from .compression_utils import (
.tox/test/lib/python3.14/site-packages/aiohttp/compression_utils.py:25: in <module>
import compression.zstd # noqa: I900
^^^^^^^^^^^^^^^^^^^^^^^
/opt/python/3.14/lib/python3.14/compression/zstd/__init__.py:29: in <module>
import _zstd
E ModuleNotFoundError: No module named '_zstd'
The compression.zstd import should guard against the ModuleNotFoundError/ImportError like it does for import zstandard on <=3.13.
To Reproduce
- Build CPython without zstd support.
- run
import aiohttp
Expected behavior
No ImportError.
Logs/tracebacks
See above.Python Version
3.14.0rc1aiohttp Version
3.13.0multidict Version
n/apropcache Version
n/ayarl Version
n/aOS
RHEL 8
Related component
Client, Server
Additional context
No response
Code of Conduct
- I agree to follow the aio-libs Code of Conduct
Reactions are currently unavailable