Author jfine2358
Recipients Steve Pryde, jfine2358, scoder, steven.daprano, xtreak
Date 2019-01-30.19:14:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
For information - all taken from docs and Lib/*.py
traceback -- Print or retrieve a stack traceback
Source code: Lib/
This module provides a standard interface to extract, format and print stack traces of Python programs. It exactly mimics the behavior of the Python interpreter when it prints a stack trace. This is useful when you want to print stack traces under program control, such as in a “wrapper” around the interpreter.
        for f, lineno in frame_gen:
            co = f.f_code
            filename = co.co_filename
            name = co.co_name

            linecache.lazycache(filename, f.f_globals)
            # Must defer line lookups until we have called checkcache.
            if capture_locals:
                f_locals = f.f_locals
                f_locals = None
                filename, lineno, name, lookup_line=False, locals=f_locals))
        for filename in fnames:
By the way, here fnames is a set.
linecache -- Random access to text lines
The linecache module allows one to get any line from a Python source file, while attempting to optimize internally, using a cache, the common case where many lines are read from a single file. This is used by the traceback module to retrieve source lines for inclusion in the formatted traceback.

Check the cache for validity. Use this function if files in the cache may have changed on disk, and you require the updated version. If filename is omitted, it will check all the entries in the cache.

linecache.lazycache(filename, module_globals)
Capture enough detail about a non-file-based module to permit getting its lines later via getline() even if module_globals is None in the later call. This avoids doing I/O until a line is actually needed, without having to carry the module globals around indefinitely.
Date User Action Args
2019-01-30 19:14:26jfine2358setrecipients: + jfine2358, scoder, steven.daprano, xtreak, Steve Pryde
2019-01-30 19:14:25jfine2358setmessageid: <>
2019-01-30 19:14:25jfine2358linkissue35857 messages
2019-01-30 19:14:25jfine2358create