Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the "htmlcharrefreplace" error handler #63866

Open
serhiy-storchaka opened this issue Nov 20, 2013 · 4 comments
Open

Add the "htmlcharrefreplace" error handler #63866

serhiy-storchaka opened this issue Nov 20, 2013 · 4 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 19667
Nosy @malemburg, @terryjreedy, @pfmoore, @pitrou, @ezio-melotti, @stevendaprano, @berkerpeksag, @serhiy-storchaka
Files
  • htmlcharrefreplace.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2013-11-20.18:19:35.998>
    labels = ['type-feature', 'library']
    title = 'Add the "htmlcharrefreplace" error handler'
    updated_at = <Date 2015-07-21.10:43:55.588>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2015-07-21.10:43:55.588>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2013-11-20.18:19:35.998>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['32727']
    hgrepos = []
    issue_num = 19667
    keywords = ['patch']
    message_count = 4.0
    messages = ['203517', '203542', '203581', '203651']
    nosy_count = 8.0
    nosy_names = ['lemburg', 'terry.reedy', 'paul.moore', 'pitrou', 'ezio.melotti', 'steven.daprano', 'berker.peksag', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue19667'
    versions = ['Python 3.6']

    @serhiy-storchaka
    Copy link
    Member Author

    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 .

    @serhiy-storchaka serhiy-storchaka added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Nov 20, 2013
    @ezio-melotti
    Copy link
    Member

    As I wrote in the thread, I don't like this too much.

    @serhiy-storchaka
    Copy link
    Member Author

    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.

    @pitrou
    Copy link
    Member

    pitrou commented Nov 21, 2013

    As long as it isn't built-in, I see no problems for including it personally.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    Development

    No branches or pull requests

    3 participants