This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author andrei.avk
Recipients andrei.avk
Date 2021-06-20.03:40:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1624160430.21.0.153812631131.issue44465@roundup.psfhosted.org>
In-reply-to
Content
There are a few places where old code does essentially the same thing as `html.escape()`, and can be replaced with html.escape():

 - more readable
 - less error prone on refactorings
 - will benefit if html.escape() performance is improved in the future
 - will be easier to grep for in case in the future html.escape() is enhanced with new escapes & it will be useful to consider applying it to all instances where it is used.

Here's what I found:

https://github.com/python/cpython/blob/main/Lib/difflib.py#L1914

https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/plistlib.py#L158

https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/pydoc.py#L525

https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/xml/dom/minidom.py#L306

(^ keep existing escape of double quote)

https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/xml/sax/saxutils.py#L27

https://github.com/python/cpython/blob/09eb81711597725f853e4f3b659ce185488b0d8c/Lib/xmlrpc/client.py#L149

I can add a PR if this sounds good.
History
Date User Action Args
2021-06-20 03:40:30andrei.avksetrecipients: + andrei.avk
2021-06-20 03:40:30andrei.avksetmessageid: <1624160430.21.0.153812631131.issue44465@roundup.psfhosted.org>
2021-06-20 03:40:30andrei.avklinkissue44465 messages
2021-06-20 03:40:29andrei.avkcreate