protocolbuffers / protocolbuffers/protobuf
Support free-threaded CPython (3.13t)
Open
@anandolee is already working on this.
Since Aug 20, 2025.
keep open
python
- Dominant language
- C++
- Stars
- 72k
- Forks
- 16.3k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 140
Description
This issue is intended to track the efforts of adding support for the free-threaded build for CPython (either 3.13t or 3.14t). The Python free-threading guide contains some helpful advice on approaching this task. Based on that guide, I think the following steps make sense:
- Define and document the thread safety guarantees that apply to the
protobufpackage. - Revise pure-Python version of the package to meet those guarantees.
- Revise the "upb" backend.
- Revise the "cpp" backend, only if there is a concrete need for a free-threaded compatible version of it.
Related issues and PRs:
- #20304 : Some discussion about free-threaded support occurred in this issue.
#23017#23056#23024#22736- #23202: This PR includes changes from previous 3 PRs and fixes the .so filename bug.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.