diff options
author | Georg Brandl <georg@python.org> | 2005-06-26 21:57:55 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2005-06-26 21:57:55 (GMT) |
commit | 07c81d9074fd72cb6a7ad1548685a87d5a764a09 (patch) | |
tree | ef8c0ed545966a6ab12cd5cc09f890e4519e168d /Lib/cgitb.py | |
parent | fbff1bcd697fd062f281097102b0c2b372a19033 (diff) | |
download | cpython-07c81d9074fd72cb6a7ad1548685a87d5a764a09.zip cpython-07c81d9074fd72cb6a7ad1548685a87d5a764a09.tar.gz cpython-07c81d9074fd72cb6a7ad1548685a87d5a764a09.tar.bz2 |
Prevent creating a HTML link to file://?/
Diffstat (limited to 'Lib/cgitb.py')
-rw-r--r-- | Lib/cgitb.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/cgitb.py b/Lib/cgitb.py index 735683e..8d979b8 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.</p>''' frames = [] records = inspect.getinnerframes(etb, context) for frame, file, lnum, func, lines, index in records: - file = file and os.path.abspath(file) or '?' - link = '<a href="file://%s">%s</a>' % (file, pydoc.html.escape(file)) + if file: + file = os.path.abspath(file) + link = '<a href="file://%s">%s</a>' % (file, pydoc.html.escape(file)) + else: + file = link = '?' args, varargs, varkw, locals = inspect.getargvalues(frame) call = '' if func != '?': |