[issue14655] traceback module docs should show how to print/fomat an exception object

2021-01-08 Thread Irit Katriel
Irit Katriel added the comment: In issue 26389 the api was changed so that now format_exception(exc) works. -- resolution: -> duplicate stage: needs patch -> resolved status: open -> closed superseder: -> Expand traceback module API to accept just an exception as an argument __

[issue14655] traceback module docs should show how to print/fomat an exception object

2020-11-04 Thread Irit Katriel
Irit Katriel added the comment: As of 3.5 there is this option: traceback.TracebackException.from_exception(exc).format() Perhaps that can be mentioned in the doc for traceback.format_exception(). -- assignee: -> docs@python components: +Documentation nosy: +docs@python, iritkatrie

[issue14655] traceback module docs should show how to print/fomat an exception object

2012-04-23 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue14655] traceback module docs should show how to print/fomat an exception object

2012-04-23 Thread R. David Murray
R. David Murray added the comment: Sounds OK to me, though I am worried others will think that kind of variable signature (where the type of the first argument depends on the number of arguments passed) is bad. -- ___ Python tracker

[issue14655] traceback module docs should show how to print/fomat an exception object

2012-04-23 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Why not reuse format_exception(exc)? in 2.7 you could write "raise type, value, traceback", or "raise value". I suggest that traceback.format_exception take the same route, and accept both (type, value, traceback) and (value). -- nosy: +amaury.fo

[issue14655] traceback module docs should show how to print/fomat an exception object

2012-04-23 Thread R. David Murray
New submission from R. David Murray : Suppose you have an exception object acquired from somewhere. The exception is no longer active on the stack. Now you want to format the exception like format_exception would (to log it, perhaps). To do this you apparently need to call: format_except