[issue43377] _PyErr_Display should be available in the CPython-specific API

2021-07-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > PErr_Display (without underscore) is already exposed. > This issue is about adding a variant with an additional output file argument. Oh, I was not aware of that :( Apologies for the confusion! -- ___

[issue43377] _PyErr_Display should be available in the CPython-specific API

2021-07-28 Thread Petr Viktorin
Petr Viktorin added the comment: PyErr_Display (without underscore) is already exposed. This issue is about adding a variant with an additional output file argument. The function formats an exception "just as Python would". The exact output will naturally be different between versions, but

[issue43377] _PyErr_Display should be available in the CPython-specific API

2021-07-27 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: PyErr_Display is not exposed partially because is full of small details of the interpreter and we change it constantly without regard for backwards compatibility on purpose. Exposing it will restrict us a lot on how we display error messages or the

[issue43377] _PyErr_Display should be available in the CPython-specific API

2021-07-27 Thread Petr Viktorin
Petr Viktorin added the comment: If it should be exposed, it should be renamed to a public (non-underscored) name, like PyErr_DisplayToFile. It should also ideally get documentation and tests (along with PyErr_Display, which is sadly missing those as well). (Also, note that there are no no

[issue43377] _PyErr_Display should be available in the CPython-specific API

2021-03-03 Thread Max Bélanger
Change by Max Bélanger : -- keywords: +patch nosy: +maxbelanger nosy_count: 1.0 -> 2.0 pull_requests: +23495 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24719 ___ Python tracker

[issue43377] _PyErr_Display should be available in the CPython-specific API

2021-03-02 Thread Maxime Belanger
New submission from Maxime Belanger : We have found `_PyErr_Display` to be quite helpful in embedding situations, in particular as a way to capture errors to a custom buffer rather than to `stderr`. Otherwise, embedders often have to replicate logic in `PyErr_Print`, etc. Since the header