Open
Description
Problem Description
In #1697 we removed the old method for adding C++ backtraces to Python, since Python's _PyTraceback_Add
is no longer part of the public API.
An even older solution that we used before #1496 also doesn't work anymore. We should find a better way to propagate backtraces that do not depend on unstable Python features.
Solutions?
We could solve this in several ways:
- Print the C++ exception backtrace in the C++ code, then forward the exception to Python and raise a Python exception
- Forward the C++ message to Python and include it in the Python exception message (this was proposed in Make _PyTraceback_Add public python/cpython#68931 (comment))
- Do not forward C++ exceptions to Python and simply terminate in C++.