bpo-33256: Replace angle brackets around python object repr to displa… · python/cpython@7d68bfa

Original file line numberDiff line numberDiff line change

@@ -124,7 +124,7 @@ def html(einfo, context=5):

124124

args, varargs, varkw, locals = inspect.getargvalues(frame)

125125

call = ''

126126

if func != '?':

127-

call = 'in ' + strong(func) + \

127+

call = 'in ' + strong(pydoc.html.escape(func)) + \

128128

inspect.formatargvalues(args, varargs, varkw, locals,

129129

formatvalue=lambda value: '=' + pydoc.html.repr(value))

130130

@@ -282,7 +282,7 @@ def handle(self, info=None):

282282
283283

if self.display:

284284

if plain:

285-

doc = doc.replace('&', '&amp;').replace('<', '&lt;')

285+

doc = pydoc.html.escape(doc)

286286

self.file.write('<pre>' + doc + '</pre>\n')

287287

else:

288288

self.file.write(doc + '\n')