Author lemburg
Recipients barry, ezio.melotti, flox, lemburg, ncoghlan, vstinner
Date 2013-11-10.13:21:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <527F884F.7090607@egenix.com>
In-reply-to <1384088582.54.0.79854368528.issue17828@psf.upfronthosting.co.za>
Content
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".
History
Date User Action Args
2013-11-10 13:21:30lemburgsetrecipients: + lemburg, barry, ncoghlan, vstinner, ezio.melotti, flox
2013-11-10 13:21:30lemburglinkissue17828 messages
2013-11-10 13:21:29lemburgcreate