The problem is that if actual application code raises a weird exception like this one and you use --tbformat=emacs it is hard to figure out where the exception came from. Making trial more robust in reporting these would be nice.

Could you also update the docstring of the method you're updating (printTraceback), put it on 3 lines and add epytext for it's arguments? That way we can get a better understanding of the "brief" reference you make in the NEWS file. Personally I would also format all of the methods pep8-style but I know you're not a fan of doing that for a whole module :) Cheers.

Fix the error handling in Failure.printTraceback in the "brief"
detail mode so that exceptions which raise an exception when being
converted to a string do not cause printTraceback itself to raise
an exception.

Fix the error handling in Failure.printTraceback in the "brief"
detail mode so that exceptions which raise an exception when being
converted to a string do not cause printTraceback itself to raise
an exception.

Re-merge includes the last revision from the branch which was
accidentally omitted in the first merge.