Repository navigation
Drop the free-threaded Python 3.13 code path - #1524
Merged
asvetlov merged 2 commits intoSep 23, 2026
Merged
Conversation
Support for 3.13t was dropped in v6.8.0, when cibuildwheel stopped building cp313t wheels, but the C extension kept a second free-threaded arm for interpreters without PyUnstable_TryIncRef(), which 3.13t is the only one of. It was never built in CI and duplicated md_get_one() and the md_contains() dispatch. Py_GIL_DISABLED now implies CPython 3.14 or newer, enforced by an #error in freethreading.h so an unsupported free-threaded build fails loudly instead of silently compiling an untested path. GIL builds are unaffected down to 3.10.
asvetlov
marked this pull request as ready for review
September 23, 2026 09:53
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What do these changes do?
Support for free-threaded Python 3.13 was dropped in v6.8.0 (#1326),
once cibuildwheel stopped building cp313t wheels, but the C extension
kept a second free-threaded code path for interpreters without
PyUnstable_TryIncRef(), of which 3.13t is the only one. It was neverbuilt in CI, never tested, and it duplicated
md_get_one()and themd_contains()dispatch outright.Py_GIL_DISABLEDnow implies CPython 3.14 or newer. That assumption isenforced by an
#errorinfreethreading.h, so a free-threaded buildon 3.13t fails with a clear compiler message instead of silently
compiling an untested lock-free path (the vendored
pythoncapi_compat.hpolyfills those calls, so it would otherwisebuild).
_MD_HAVE_TRYINCREFand every branch keyed on it are gone.Only the C extension is affected. The pure-Python backend is
version-agnostic and unchanged, and builds with the GIL enabled still
go down to Python 3.10.
Are there changes in behavior for the user?
No, on every supported build. The disassembly of
_multidict.soisidentical before and after on both a free-threaded 3.14t build and a
GIL build. On an unsupported free-threaded 3.13t interpreter, building
from source now fails at compile time rather than producing an
untested extension.
Is it a substantial burden for the maintainers to support this?
No, it removes code.
Related issue number
None; follow-up cleanup after #1326.
Checklist
existing free-threading tests cover the surviving path
CONTRIBUTORS.txt— N/A, no such file in this repoCHANGES/foldermake doc-spellingpasses and any new technical words are added todocs/spelling_wordlist.txtDrafted with Claude Code (Opus 5); reviewed by @asvetlov.
Agent run details (optional, for reviewers)
Codegen check, per build,
objdump -dwith addresses normalised,before vs. after: identical on 3.14.7t (free-threaded) and on 3.14.2
(GIL). The only difference is the file name in the objdump header.
Tests:
--no-c-extensions: 1103 passed, 9 skippedMULTIDICT_DEBUG_BUILD=1: 2187 passed, 32 skippedGuard behaviour:
at
freethreading.h:25:2: error: #error "the free-threaded build requires CPython 3.14 or newer".Lint:
pre-commit run --all-filespassed;make doc-spellingpassed.ThreadSanitizer was not run: the emitted code on 3.14t is unchanged, so
there is no new interleaving for it to exercise.