diff options
author | sblondon <sblondon@users.noreply.github.com> | 2018-04-29 17:48:33 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-04-29 17:48:33 (GMT) |
commit | 7d68bfa82654ba01d860b8a772ff63bf0bd183ee (patch) | |
tree | e4a03a4c0cfc7be75b1cdea0aba531b930a18461 /Lib/cgitb.py | |
parent | 70af06cdc4e8fbee0b9d7d46bdc193097d4bc71f (diff) | |
download | cpython-7d68bfa82654ba01d860b8a772ff63bf0bd183ee.zip cpython-7d68bfa82654ba01d860b8a772ff63bf0bd183ee.tar.gz cpython-7d68bfa82654ba01d860b8a772ff63bf0bd183ee.tar.bz2 |
bpo-33256: Replace angle brackets around python object repr to display it in html (GH-6442)
Diffstat (limited to 'Lib/cgitb.py')
-rw-r--r-- | Lib/cgitb.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/cgitb.py b/Lib/cgitb.py index b291100..0f5f32c0 100644 --- a/Lib/cgitb.py +++ b/Lib/cgitb.py @@ -124,7 +124,7 @@ function calls leading up to the error, in the order they occurred.</p>''' args, varargs, varkw, locals = inspect.getargvalues(frame) call = '' if func != '?': - call = 'in ' + strong(func) + \ + call = 'in ' + strong(pydoc.html.escape(func)) + \ inspect.formatargvalues(args, varargs, varkw, locals, formatvalue=lambda value: '=' + pydoc.html.repr(value)) @@ -282,7 +282,7 @@ class Hook: if self.display: if plain: - doc = doc.replace('&', '&').replace('<', '<') + doc = pydoc.html.escape(doc) self.file.write('<pre>' + doc + '</pre>\n') else: self.file.write(doc + '\n') |