summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2005-06-26 21:57:55 (GMT)
committerGeorg Brandl <georg@python.org>2005-06-26 21:57:55 (GMT)
commit07c81d9074fd72cb6a7ad1548685a87d5a764a09 (patch)
treeef8c0ed545966a6ab12cd5cc09f890e4519e168d
parentfbff1bcd697fd062f281097102b0c2b372a19033 (diff)
downloadcpython-07c81d9074fd72cb6a7ad1548685a87d5a764a09.zip
cpython-07c81d9074fd72cb6a7ad1548685a87d5a764a09.tar.gz
cpython-07c81d9074fd72cb6a7ad1548685a87d5a764a09.tar.bz2
Prevent creating a HTML link to file://?/
-rw-r--r--Lib/cgitb.py7
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 != '?':