These honor traceback supplements as defined in zope.exceptions.
Function | print_list | Print the list of tuples as returned by extract_tb() or |
Function | format_list | Format a list of traceback entry tuples for printing. |
Function | print_stack | Print a stack trace from its invocation point. |
Function | extract_stack | Extract the raw traceback from the current stack frame. |
Function | extract_tb | Return list of up to limit pre-processed entries from traceback. |
Function | _try_except | Undocumented |
Function | _get_frame | if the frame is None, make one. |
Function | _fmt | Return the string as deemed suitable for the extra information. |
Function | _get_limit | Return the limit or the globally-set limit, if any. |
Function | _get_frame_data | Given a frame and a lineno, return data for each item of extract_*. |
Given a list of tuples as returned by extract_tb() or extract_stack(), return a list of strings ready for printing. Each string in the resulting list corresponds to the item with the same index in the argument list. Each string ends in a newline; the strings may contain internal newlines as well, for those items whose source text line or supplement or info are not None.
The optional 'f' argument can be used to specify an alternate stack frame at which to start. The optional 'limit' and 'file' arguments have the same meaning as for print_exception().
The return value has the same format as for extract_tb(). The optional 'f' and 'limit' arguments have the same meaning as for print_stack(). Each item in the list is a septuple (filename, line number, function name, text, module name, optional supplement dict, optional info string), and the entries are in order from oldest to newest stack frame.
This is useful for alternate formatting of stack traces. If 'limit' is omitted or None, all entries are extracted. A pre-processed stack trace entry is a sextuple (filename, line number, function name, text, module name, optional supplement dict, optional info string) representing the information that is printed for a stack trace. The text is a string with leading and trailing whitespace stripped; if the source is not available it is None. The supplement dict has keys 'source_url', 'line', 'column', 'expression', 'warnings' (an iterable), and 'extra', any of which may be None.