traceback

Extract, format and print information about Python stack traces.

Functions

extract_stack([f, limit]) Extract the raw traceback from the current stack frame.
extract_tb(tb[, limit]) Return list of up to limit pre-processed entries from traceback.
format_exc([limit]) Like print_exc() but return a string.
format_exception(etype, value, tb[, limit]) Format a stack trace and the exception information.
format_exception_only(etype, value) Format the exception part of a traceback.
format_list(extracted_list) Format a list of traceback entry tuples for printing.
format_stack([f, limit]) Shorthand for ‘format_list(extract_stack(f, limit))’.
format_tb(tb[, limit]) A shorthand for ‘format_list(extract_tb(tb, limit))’.
print_exc([limit, file]) Shorthand for ‘print_exception(sys.exc_type, sys.exc_value, sys.exc_traceback, limit, file)’.
print_exception(etype, value, tb[, limit, file]) Print exception up to ‘limit’ stack trace entries from ‘tb’ to ‘file’.
print_last([limit, file]) This is a shorthand for ‘print_exception(sys.last_type, sys.last_value, sys.last_traceback, limit, file)’.
print_list(extracted_list[, file]) Print the list of tuples as returned by extract_tb() or extract_stack() as a formatted stack trace to the given file.
print_stack([f, limit, file]) Print a stack trace from its invocation point.
print_tb(tb[, limit, file]) Print up to ‘limit’ stack trace entries from the traceback ‘tb’.
tb_lineno(tb) Calculate correct line number of traceback given in tb.