Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 07ad02f

Browse filesBrowse files
[2.7] bpo-33256: Replace angle brackets around python object repr to display it in html (GH-6442). (GH-6650)
(cherry picked from commit 7d68bfa) Co-authored-by: sblondon <sblondon@users.noreply.github.com>
1 parent 07c3a61 commit 07ad02f
Copy full SHA for 07ad02f

File tree

Expand file treeCollapse file tree

3 files changed

+4
-2
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+4
-2
lines changed

‎Lib/cgitb.py

Copy file name to clipboardExpand all lines: Lib/cgitb.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def html(einfo, context=5):
125125
args, varargs, varkw, locals = inspect.getargvalues(frame)
126126
call = ''
127127
if func != '?':
128-
call = 'in ' + strong(func) + \
128+
call = 'in ' + strong(pydoc.html.escape(func)) + \
129129
inspect.formatargvalues(args, varargs, varkw, locals,
130130
formatvalue=lambda value: '=' + pydoc.html.repr(value))
131131

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

286286
if self.display:
287287
if plain:
288-
doc = doc.replace('&', '&amp;').replace('<', '&lt;')
288+
doc = pydoc.html.escape(doc)
289289
self.file.write('<pre>' + doc + '</pre>\n')
290290
else:
291291
self.file.write(doc + '\n')

‎Misc/ACKS

Copy file name to clipboardExpand all lines: Misc/ACKS
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ Mike Bland
138138
Martin Bless
139139
Pablo Bleyer
140140
Erik van Blokland
141+
Stéphane Blondon
141142
Eric Blossom
142143
Sergey Bobrov
143144
Finn Bock
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix display of ``<module>`` call in the html produced by ``cgitb.html()``. Patch by Stéphane Blondon.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.