New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We need to add the set_exc_info() function to the standard library #99478
Comments
Most likely it is related to the new exception features: https://docs.python.org/3/library/sys.html#sys.exception (but, again, we never promised that anything from CC @iritkatriel |
|
I don’t think this is a bug report about a private API changing. Rather, it’s a request to expose and support the equivalent functionality in a future release. |
|
Yes, I'm saying that it would be good to add this functionality in a future release. We don't need to fix it in the module |
|
In 3.11 you can modify the traceback on the "exc_info" exception and it will stick: See how raiseTypeError raised a ValueError? You can also use |
|
Marking as pending because I don't think I see a use case for exposing set_exc_info, given my previous comment. |
|
Closing. If you do still have an issue this can't solve, please reopen or create a new issue. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Feature or enhancement
We need to move the
set_exc_info()function from the_testcapimodule to the standard library.Pitch
I am a developer of a logging library named polog. In this library, it is possible to hang a decorator on any function that will record what is happening in it. It looks like:
In the case when an exception is raised inside this function, this decorator records information about it. But the decorator itself does not affect the exception traceback, does not "clog" it. The traceback that you will see in the console looks the same as if there was no decorator. Because of this, logging becomes completely transparent to the user, and he no longer has any reason to avoid logging his code. I implemented this using the function
set_exc_info()from the_testcapimodule. There is something similar to the code of my library:This code contains some problems. First: it worked on python 3.9 and 3.10, but it stopped working on python 3.11. Second: this code is not officially supported as part of the python standard library. This creates a risk that the library that depends on this feature will not work properly or will stop working altogether.
The text was updated successfully, but these errors were encountered: