Marc-Andre Lemburg added the comment: On 10.11.2013 14:03, Nick Coghlan wrote: > > Updated patch (v5) with a more robust chaining mechanism provided as a > private "_PyErr_TrySetFromCause" API. This version eliminates the previous > whitelist in favour of checking directly for the ability to replace the > exception with another instance of the same type without losing information. > > This version also has more direct tests of the exception wrapping behaviour > as a dedicated test class. > > If I don't hear any objections in the next couple of days, I plan to commit > this version.
This doesn't look right: diff -r 1ee45eb6aab9 Include/pyerrors.h --- a/Include/pyerrors.h Sat Nov 09 23:15:52 2013 +0200 +++ b/Include/pyerrors.h Sun Nov 10 22:54:04 2013 +1000 ... +PyAPI_FUNC(PyObject *) _PyErr_TrySetFromCause( + const char *prefix_format, /* ASCII-encoded string */ + ... + ); BTW: Why don't we make that API a public one ? It could be useful in C extensions as well. In the error messages, I'd use "codecs.encode()" and "codecs.decode()" (ie. with parens) instead of "codecs.encode" and "codecs.decode". ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17828> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com