[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2020-05-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: > The documentation of PyErr_SetObject, PyErr_SetString et al should also be > updated to mention exception chaining. I just posted a PR to do the above: https://github.com/python/cpython/pull/20329 -- ___ Python

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2020-05-22 Thread Chris Jerdonek
Change by Chris Jerdonek : -- keywords: +patch pull_requests: +19597 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/20329 ___ Python tracker

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2020-05-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: I just want to point out one difference between _PyErr_ChainExceptions and PyErr_SetObject that I encountered while working on this issue: https://bugs.python.org/issue40696 While both functions set the context, only PyErr_SetObject does a check to prevent

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2020-05-21 Thread Chris Jerdonek
Change by Chris Jerdonek : -- nosy: +chris.jerdonek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2018-05-23 Thread Nick Coghlan
Nick Coghlan added the comment: Also see https://github.com/python/cpython/blob/55edd0c185ad2d895b5d73e47d67049bc156b654/Objects/exceptions.c#L2713 for the version we use in a few places to implicitly update the exception message, while keeping the exception type and

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2018-05-22 Thread Eric Snow
Eric Snow added the comment: good point :) -- ___ Python tracker ___ ___

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2018-05-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is usually more complex code between PyErr_Fetch() and _PyErr_ChainExceptions(): PyObject *exc, *val, *tb, *close_result; PyErr_Fetch(, , ); close_result = _PyObject_CallMethodId(result, _close,

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2018-05-22 Thread Eric Snow
Eric Snow added the comment: FTR, see PEP 490 ("Chain exceptions at C level") which proposed implicitly chaining exceptions in the PyErr_* API. While that PEP was rejected (not all exceptions should be chained), it does make a good point about the clunkiness of

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2016-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This helper is convenient in many cases, but it is very limited. It raises an exception with single string argument. It doesn't work in cases when the exception doesn't take arguments (PyErr_SetNone) or takes multiple or non-string arguments

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2016-10-18 Thread Nick Coghlan
Nick Coghlan added the comment: Via issue 28410, Serhiy is adding a private "_PyErr_FormatFromCause" helper API to make explicit C level exception chaining easier within the implementation of CPython (this helps resolve issue 28214, an exception reporting problem in the new PEP 487

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2015-06-27 Thread Nick Coghlan
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: ncoghlan - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23188 ___ ___ Python-bugs-list

[issue23188] Provide a C helper function to chain raised (but not yet caught) exceptions

2015-01-10 Thread Nick Coghlan
Nick Coghlan added the comment: Updated the issue title and type again based on Antoine's explanation. -- title: Exception chaining should trigger for non-normalised exceptions - Provide a C helper function to chain raised (but not yet caught) exceptions type: behavior - enhancement