Nick Coghlan added the comment:

Looking more closely at the patch:

* for the missing tracebacks, you're probably hitting the note in 
https://docs.python.org/3/c-api/exceptions.html#c.PyErr_NormalizeException and 
need an explicit call to PyErr_SetTraceback (My recollection is that I made 
this same mistake when working on the codec chaining patch, so we may want to 
revisit the comment before PyErr_NormalizeException that suggests making 
setting the traceback attribute on the normalized value implicit)

* to trigger the implicit chaining in PyErr_String, try calling PyErr_Restore 
on the normalized exception before calling PyErr_SetString, rather than just 
dropping the references. That should let you drop the subsequent explicit 
PyErr_SetContext call.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22906>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to