Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7d68bfa8
Commit
7d68bfa8
authored
Apr 29, 2018
by
sblondon
Committed by
Serhiy Storchaka
Apr 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-33256: Replace angle brackets around python object repr to display it in html (GH-6442)
parent
70af06cd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
2 deletions
+5
-2
Lib/cgitb.py
Lib/cgitb.py
+2
-2
Lib/test/test_cgitb.py
Lib/test/test_cgitb.py
+1
-0
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS.d/next/Library/2018-04-10-20-57-14.bpo-33256.ndHkqu.rst
...S.d/next/Library/2018-04-10-20-57-14.bpo-33256.ndHkqu.rst
+1
-0
No files found.
Lib/cgitb.py
View file @
7d68bfa8
...
...
@@ -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
'
)
...
...
Lib/test/test_cgitb.py
View file @
7d68bfa8
...
...
@@ -45,6 +45,7 @@ class TestCgitb(unittest.TestCase):
out
=
out
.
decode
(
sys
.
getfilesystemencoding
())
self
.
assertIn
(
"ValueError"
,
out
)
self
.
assertIn
(
"Hello World"
,
out
)
self
.
assertIn
(
"<strong><module></strong>"
,
out
)
# By default we emit HTML markup.
self
.
assertIn
(
'<p>'
,
out
)
self
.
assertIn
(
'</p>'
,
out
)
...
...
Misc/ACKS
View file @
7d68bfa8
...
...
@@ -158,6 +158,7 @@ Mike Bland
Martin Bless
Pablo Bleyer
Erik van Blokland
Stéphane Blondon
Eric Blossom
Sergey Bobrov
Finn Bock
...
...
Misc/NEWS.d/next/Library/2018-04-10-20-57-14.bpo-33256.ndHkqu.rst
0 → 100644
View file @
7d68bfa8
Fix display of ``<module>`` call in the html produced by ``cgitb.html()``. Patch by Stéphane Blondon.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment