bpo-33256: Replace square brackets around python object repr to display it in html#6442
Conversation
| call = '' | ||
| if func != '?': | ||
| call = 'in ' + strong(func) + \ | ||
| call = 'in ' + strong(func.replace("<", "<").replace(">", ">")) + \ |
There was a problem hiding this comment.
You could call pydoc.html.escape like the rest of the code. Maybe it doesn’t matter too much here, but in general it is important to escape ampersands.
There was a problem hiding this comment.
@vadmium Thank you for the review. :) It's fixed now.
| call = '' | ||
| if func != '?': | ||
| call = 'in ' + strong(func) + \ | ||
| call = 'in ' + strong(pydoc.html.escape(func)) + \ |
There was a problem hiding this comment.
You can use pydoc.html.escape() also in line 285.
There was a problem hiding this comment.
Line 285 is not modified by the patch but I agree it's good to reuse pydoc.html.escape() there.
I committed the requested change.
| @@ -0,0 +1 @@ | |||
| Fix display of ``<module>`` call in the html produced by ``cgitb.html()``. | |||
There was a problem hiding this comment.
Please add "Patch by your name." And add your name in Misc/ACKS if it was not added before.
|
Thanks @sblondon for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6, 3.7. |
|
GH-6637 is a backport of this pull request to the 3.7 branch. |
…y it in html (pythonGH-6442) (cherry picked from commit 7d68bfa) Co-authored-by: sblondon <[email protected]>
|
Sorry, @sblondon and @serhiy-storchaka, I could not cleanly backport this to |
…y it in html (pythonGH-6442) (cherry picked from commit 7d68bfa) Co-authored-by: sblondon <[email protected]>
|
GH-6638 is a backport of this pull request to the 3.6 branch. |
…y it in html (GH-6442) (cherry picked from commit 7d68bfa) Co-authored-by: sblondon <[email protected]>
…y it in html (GH-6442) (cherry picked from commit 7d68bfa) Co-authored-by: sblondon <[email protected]>
…display it in html (pythonGH-6442). (cherry picked from commit 7d68bfa) Co-authored-by: sblondon <[email protected]>
|
GH-6650 is a backport of this pull request to the 2.7 branch. |
…display it in html (GH-6442). (GH-6650) (cherry picked from commit 7d68bfa) Co-authored-by: sblondon <[email protected]>
This PR replace '<' and '>' in
funcso an representation of an object will be displayed. It will not change the display of functions.https://bugs.python.org/issue33256