python / python/cpython

_PyErr_ChainExceptions1 no longer avallable to extension modules in Python 3.13 alpha headers

Open
#116,809 21 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3.13 3.14 topic-C-API type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

The API _PyErr_ChainExceptions1 has been removed from public headers as part of this change in Python 3.13 alpha. It is the only C API available to chain exceptions replacing _PyErr_ChainExceptions. That change was publicly documented in the 3.12 whatsnew.

In my extemsion module I use _PyErr_ChainExceptions for exception chaining for Python <= 3.11 from PEP 490 and _PyErr_ChainExceptions1for 3.12+.

Please provide an approved way for C extensions to continue to chain exceptions. The function is still present and I can duplicate the prototype for all to continue working, but that is not a desirable solution.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs
  • gh-116900

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.

Research direction

Start with the referenced Python 3.13 alpha change in issue 106320 and the linked PR gh-116900, then review how the public C API exposes exception chaining across Python 3.11–3.13. Done means an approved way for extension modules to chain exceptions is established without duplicating a private prototype.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
api
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.