debuggingtestingand profiling blocks parse(blocksfile "blocks py"line in recursive_descent_parse return data stack[ indexerrorlist index out of range tracebacks (also called backtraceslike this should be read from their last line back toward their first line the last line specifies the unhandled exception that occurred above this linethe filenameline numberand function namefollowed by the line that caused the exceptionare shown (spread over two linesif the function where the exception was raised was called by another functionthat function' filenameline numberfunction nameand calling line are shown above and if that function was called by another function the same appliesall the way up to the beginning of the call stack (note that the filenames in tracebacks are given with their pathbut in most cases we have omitted paths from the examples for the sake of clarity function references so in this examplean indexerror occurredmeaning that data stack is some kind of sequencebut has no item at position the error occurred at line in the blocks py program' recursive_descent_parse(functionand that function was called at line in the main(function (the reason that the function' name is different at line that isparse(instead of recursive_descent_parse()is that the parse variable is set to one of several different functions depending on the command-line arguments given to the programin the common case the names always match the call to main(was made at line and this is the statement at which program execution commenced although at first sight the traceback looks intimidatingnow that we understand its structure it is easy to see how useful it is in this case it tells us exactly where to look for the problemalthough of course we must work out for ourselves what the solution is here is another example tracebacktraceback (most recent call last)file "blocks py"line in main(file "blocks py"line in main if blockoutput save_blocks_as_svg(blockssvg)file "blockoutput py"line in save_blocks_as_svg widthsrows compute_widths_and_rows(cellsscale_byfile "blockoutput py"line in compute_widths_and_rows width len(cell text/cell columns zerodivisionerrorinteger division or modulo by zero herethe problem has occurred in module (blockoutput pythat is called by the blocks py program this traceback leads us to where the problem became apparentbut not to where it occurred the value of cell columns is