[issue35103] format_exception() doesn't work with PyErr_Fetch

2020-09-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > FWIW, I believe that you have to call `PyErr_NormalizeException` on the > values returned from `PyErr_Fetch`. It looks like this is working as expected. Indeed that is the case, from the docs: Under certain circumstances, the values returned by PyEr

[issue35103] format_exception() doesn't work with PyErr_Fetch

2020-09-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Closing as not a bug, feel free to reopen if we are missing something here :) -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker _

[issue35103] format_exception() doesn't work with PyErr_Fetch

2020-09-29 Thread Jason Haslam
Jason Haslam added the comment: FWIW, I believe that you have to call `PyErr_NormalizeException` on the values returned from `PyErr_Fetch`. It looks like this is working as expected. -- nosy: +jason.haslam ___ Python tracker

[issue35103] format_exception() doesn't work with PyErr_Fetch

2018-10-29 Thread Tomáš Heran
New submission from Tomáš Heran : When embedding Python into a C/C++ based programs, one of the ways to access the formatted traceback is/was to get the type, value and tb by calling the C API PyErr_Fetch() and then call native Python traceback.format_exception() function to get a list of stri