Issue 35595: Add sys flag to always show full paths in stack traces (instead of relative paths) (original) (raw)

I have a wsgi script writing to a log file. The contents look like this (truncated):

File "build/bdist.linux-x86_64/egg/trac/ticket/query.py", line 284, in _count % sql, args)[0][0] File "build/bdist.linux-x86_64/egg/trac/db/api.py", line 122, in execute return db.execute(query, params) File "build/bdist.linux-x86_64/egg/trac/db/util.py", line 128, in execute cursor.execute(query, params if params is not None else [])

When confronted with this logfile, I have no idea where build/bdist.linux-x86_64 lives. Rather than hoping a well-timed lsof is adequate to catch the actual script path, I'd like to be able to set a sys.flag to always log the real, fullpath of the .py script either instead of, or alongside, the file path.