bpo-36829: Add _PyErr_WriteUnraisableMsg()#13488
Conversation
|
Interesting case: _PyErr_WarnUnawaitedCoroutine(): The unraisable exception is logged with default "Exception ignored in: ..." message. Should we use a customized error message here? In my PR #13490, I have to catch stderr and sys.unraisablehook to catch the warning and the unraisable exception in test_coroutines.test_unawaited_warning_when_module_broken(): |
Sorry, something went wrong.
|
@graingert @pablogsal @serhiy-storchaka: Would you mind to review this PR? I don't recall who asked me to allow to specify a custom error message :-) |
Sorry, something went wrong.
|
I rebased my PR and merged conflicts. |
Sorry, something went wrong.
* sys.unraisablehook: add 'err_msg' field to UnraisableHookArgs. * Use _PyErr_WriteUnraisableMsg() in _ctypes _DictRemover_call() and gc delete_garbage().
|
@serhiy-storchaka: Would you mind to review the update PR? |
Sorry, something went wrong.
|
@serhiy-storchaka @pablogsal: So do you agree each other on "Exception ignored" prefix? :-) |
Sorry, something went wrong.
Yup, I'm happy with it :) |
Sorry, something went wrong.
* sys.unraisablehook: add 'err_msg' field to UnraisableHookArgs. * Use _PyErr_WriteUnraisableMsg() in _ctypes _DictRemover_call() and gc delete_garbage().
and gc delete_garbage().
https://bugs.python.org/issue36829