On 14 November 2013 00:30, Walter Dörwald <[email protected]> wrote: > On 13.11.13 14:51, nick.coghlan wrote: > >> http://hg.python.org/cpython/rev/854a2cea31b9 >> changeset: 87084:854a2cea31b9 >> user: Nick Coghlan <[email protected]> >> date: Wed Nov 13 23:49:21 2013 +1000 >> summary: >> Close #17828: better handling of codec errors >> >> - output type errors now redirect users to the type-neutral >> convenience functions in the codecs module >> - stateless errors that occur during encoding and decoding >> will now be automatically wrapped in exceptions that give >> the name of the codec involved > > > Wouldn't it be better to add an annotation API to the exceptions classes? > This would allow to annotate all exceptions without having to replace the > exception object.
There's a reason the C API for this is private - it's a band aid fix, because solving it properly is hard :) http://bugs.python.org/issue18861 covers the fact this is just one instance of a broader category of related problems related to providing good exception context information (and the issue started with a different one). Cheers, Nick. -- Nick Coghlan | [email protected] | Brisbane, Australia _______________________________________________ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
