protocolbuffers / protocolbuffers/protobuf

Support free-threaded CPython (3.13t)

Open
#23,158 4 comments 4 reactions 2 assignees View on GitHub

@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:

  1. Define and document the thread safety guarantees that apply to the protobuf package.
  2. Revise pure-Python version of the package to meet those guarantees.
  3. Revise the "upb" backend.
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.