Skip to content

Do not assume Python 3.14 has stdlib zstd - #11611

Merged
Dreamsorcerer merged 5 commits into
aio-libs:masterfrom
JacobHenner:fix/do-not-assume-stdlib-zstd
Oct 8, 2025
Merged

Dreamsorcerer merged 5 commits into
aio-libs:masterfrom
JacobHenner:fix/do-not-assume-stdlib-zstd

Conversation

@JacobHenner

@JacobHenner JacobHenner commented Oct 8, 2025 •

Copy link
Copy Markdown
Contributor

Do not assume Python 3.14 has compression.zstd available, as that module depends on a shared library version that is not available on all platforms and distributions (e.g. Rocky Linux 8).

What do these changes do?

Prevents errors when using aiohttp from a Python 3.14 build that does not include compression.zstd support.

Are there changes in behavior for the user?

Fixes bug.

Is it a substantial burden for the maintainers to support this?

No

Related issue number

Fixes #11603

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES/ folder
    • name it <issue_or_pr_num>.<type>.rst (e.g. 588.bugfix.rst)

    • if you don't have an issue number, change it to the pull request
      number after creating the PR

      • .bugfix: A bug fix for something the maintainers deemed an
        improper undesired behavior that got corrected to match
        pre-agreed expectations.
      • .feature: A new behavior, public APIs. That sort of stuff.
      • .deprecation: A declaration of future API removals and breaking
        changes in behavior.
      • .breaking: When something public is removed in a breaking way.
        Could be deprecated in an earlier release.
      • .doc: Notable updates to the documentation structure or build
        process.
      • .packaging: Notes for downstreams about unobvious side effects
        and tooling. Changes in the test invocation considerations and
        runtime assumptions.
      • .contrib: Stuff that affects the contributor experience. e.g.
        Running tests, building the docs, setting up the development
        environment.
      • .misc: Changes that are hard to assign to any of the above
        categories.
    • Make sure to use full sentences with correct case and punctuation,
      for example:

      Fixed issue with non-ascii contents in doctest text files
      -- by :user:`contributor-gh-handle`.

      Use the past tense or the present tense a non-imperative mood,
      referring to what's changed compared to the last released version
      of this project.

@JacobHenner
JacobHenner marked this pull request as ready for review October 8, 2025 15:28
@JacobHenner
JacobHenner requested a review from asvetlov as a code owner October 8, 2025 15:28
@JacobHenner
JacobHenner force-pushed the fix/do-not-assume-stdlib-zstd branch from 30f1d48 to a9cc90c Compare October 8, 2025 15:32
@JacobHenner
JacobHenner requested a review from webknjaz as a code owner October 8, 2025 15:32
@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label Oct 8, 2025
Comment thread aiohttp/compression_utils.py Outdated
Comment thread aiohttp/compression_utils.py Outdated
@codecov

codecov Bot commented Oct 8, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.74%. Comparing base (80eb0aa) to head (2878f32).
⚠️ Report is 3233 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11611      +/-   ##
==========================================
+ Coverage   98.19%   98.74%   +0.55%     
==========================================
  Files         128      127       -1     
  Lines       43758    43450     -308     
  Branches     2386     2325      -61     
==========================================
- Hits        42967    42905      -62     
+ Misses        610      389     -221     
+ Partials      181      156      -25     
Flag Coverage Δ
CI-GHA 98.63% <100.00%> (+0.55%) ⬆️
OS-Linux 98.36% <100.00%> (+0.53%) ⬆️
OS-Windows 96.69% <100.00%> (+1.15%) ⬆️
OS-macOS 97.58% <100.00%> (+0.51%) ⬆️
Py-3.10.11 97.15% <100.00%> (+0.56%) ⬆️
Py-3.10.18 97.65% <100.00%> (+0.56%) ⬆️
Py-3.11.13 97.84% <100.00%> (+0.50%) ⬆️
Py-3.11.9 97.35% <100.00%> (+0.51%) ⬆️
Py-3.12.10 97.45% <100.00%> (+0.52%) ⬆️
Py-3.12.11 97.95% <100.00%> (+0.51%) ⬆️
Py-3.13.7 98.21% <100.00%> (+0.54%) ⬆️
Py-3.14.0 98.15% <66.66%> (?)
Py-3.14.0-rc.3 ?
Py-3.14.0-rc.3t ?
Py-3.14.0t 97.22% <66.66%> (?)
Py-pypy3.10.16-7.3.19 87.97% <66.66%> (+0.16%) ⬆️
VM-macos 97.58% <100.00%> (+0.51%) ⬆️
VM-ubuntu 98.36% <100.00%> (+0.53%) ⬆️
VM-windows 96.69% <100.00%> (+1.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codspeed

codspeed Bot commented Oct 8, 2025 •

Copy link
Copy Markdown

CodSpeed Performance Report

Merging #11611 will not alter performance

Comparing JacobHenner:fix/do-not-assume-stdlib-zstd (2878f32) with master (35754d4)1

Summary

✅ 59 untouched

Footnotes

  1. No successful run was found on master (9f718eb) during the generation of this report, so 35754d4 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

Do not assume Python 3.14 has compression.zstd available, as that module
depends on a shared library version that is not available on all
platforms and distributions (e.g. Rocky Linux 8).
@JacobHenner
JacobHenner force-pushed the fix/do-not-assume-stdlib-zstd branch from a9cc90c to 1cb6a09 Compare October 8, 2025 15:51
Comment thread aiohttp/compression_utils.py Outdated
Comment thread aiohttp/compression_utils.py Outdated
@Dreamsorcerer Dreamsorcerer added backport-3.13 backport-3.14 Trigger automatic backporting to the 3.14 release branch by Patchback robot labels Oct 8, 2025
@Dreamsorcerer Dreamsorcerer reopened this Oct 8, 2025
@Dreamsorcerer
Dreamsorcerer merged commit 4929094 into aio-libs:master Oct 8, 2025
45 checks passed
@patchback

patchback Bot commented Oct 8, 2025 •

Copy link
Copy Markdown
Contributor

Backport to 3.13: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.13/49290944c0d098a85dd867a9e331cfb33a802199/pr-11611

Backported as #11612

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback Bot pushed a commit that referenced this pull request Oct 8, 2025
@patchback

patchback Bot commented Oct 8, 2025 •

Copy link
Copy Markdown
Contributor

Backport to 3.14: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.14/49290944c0d098a85dd867a9e331cfb33a802199/pr-11611

Backported as #11613

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback Bot pushed a commit that referenced this pull request Oct 8, 2025
Dreamsorcerer pushed a commit that referenced this pull request Oct 8, 2025
…lib zstd (#11613)

**This is a backport of PR #11611 as merged into master
(4929094).**

Co-authored-by: Jacob Henner <code@ventricle.us>
Dreamsorcerer pushed a commit that referenced this pull request Oct 9, 2025
…lib zstd (#11612)

**This is a backport of PR #11611 as merged into master
(4929094).**

---------

Co-authored-by: Jacob Henner <code@ventricle.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-3.14 Trigger automatic backporting to the 3.14 release branch by Patchback robot bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

import aiohttp fails on 3.14 when zstd is not installed

2 participants