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.

classification
Title: Add the "htmlcharrefreplace" error handler
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, ezio.melotti, lemburg, paul.moore, pitrou, serhiy.storchaka, steven.daprano, terry.reedy
Priority: normal Keywords: patch

Created on 2013-11-20 18:19 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin.

Files
File name Uploaded Description Edit
htmlcharrefreplace.patch serhiy.storchaka, 2013-11-20 18:19 review
Messages (4)
msg203517 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-11-20 18:19
The proposed patch adds the htmlcharrefreplace_errors() function which implements the "htmlcharrefreplace" error handler in the html module. This error handler is almost same as the "xmlcharrefreplace" error handler, but first try to replace an unencodable character to HTML named character reference. Result is a little more human-readable than with "xmlcharrefreplace".

See also a discussion on Python-Ideas: http://comments.gmane.org/gmane.comp.python.ideas/21307 .
msg203542 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-11-20 22:45
As I wrote in the thread, I don't like this too much.
msg203581 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-11-21 07:59
What should be done to make it more like you?

Paul Moore, Marc-Andre Lemburg, Ethan Furman and Terry Jan Reedy voted for it.

Steven D'Aprano proposed same idea on comp.python.general: http://comments.gmane.org/gmane.comp.python.general/742886 . And there are a number of implementations (partially buggy) in third-party code. One of them in CPython testsuite.

It would be good to have one standard implementation.
msg203651 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-11-21 16:18
As long as it isn't built-in, I see no problems for including it personally.
History
Date User Action Args
2022-04-11 14:57:53adminsetgithub: 63866
2015-07-21 10:43:55berker.peksagsetnosy: + berker.peksag

versions: + Python 3.6, - Python 3.4
2015-07-21 08:10:38ethan.furmansetnosy: - ethan.furman
2013-11-21 16:18:09pitrousetnosy: + pitrou
messages: + msg203651
2013-11-21 07:59:03serhiy.storchakasetnosy: + lemburg, terry.reedy, paul.moore, steven.daprano, ethan.furman
messages: + msg203581
2013-11-20 22:45:50ezio.melottisetmessages: + msg203542
2013-11-20 18:19:36serhiy.storchakacreate