From: Georg Brandl Date: Sun, 26 Jun 2005 21:57:55 +0000 (+0000) Subject: Prevent creating a HTML link to file://?/ X-Git-Tag: v2.5a0~1646 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=07c81d9074fd72cb6a7ad1548685a87d5a764a09;p=thirdparty%2FPython%2Fcpython.git Prevent creating a HTML link to file://?/ --- diff --git a/Lib/cgitb.py b/Lib/cgitb.py index 735683e50cfe..8d979b84453c 100644 --- a/Lib/cgitb.py +++ b/Lib/cgitb.py @@ -112,8 +112,11 @@ function calls leading up to the error, in the order they occurred.

''' frames = [] records = inspect.getinnerframes(etb, context) for frame, file, lnum, func, lines, index in records: - file = file and os.path.abspath(file) or '?' - link = '%s' % (file, pydoc.html.escape(file)) + if file: + file = os.path.abspath(file) + link = '%s' % (file, pydoc.html.escape(file)) + else: + file = link = '?' args, varargs, varkw, locals = inspect.getargvalues(frame) call = '' if func != '?':