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

Sax parser provides no user access to lexical handlers #79199

jfgossage mannequin opened this issue Oct 18, 2018 · 2 comments

Sax parser provides no user access to lexical handlers #79199

jfgossage mannequin opened this issue Oct 18, 2018 · 2 comments
3.10 expert-XML type-feature


Copy link

@jfgossage jfgossage mannequin commented Oct 18, 2018

BPO 35018
Nosy @scoder, @taleinat, @jfgossage, @ZackerySpytz
  • #10328
  • #20958
  • 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 = <Date 2020-08-09.10:52:55.486>
    created_at = <Date 2018-10-18.16:22:21.351>
    labels = ['expert-XML', 'type-feature', '3.10']
    title = 'Sax parser provides no user access to lexical handlers'
    updated_at = <Date 2020-08-09.10:52:55.486>
    user = '' fields:

    activity = <Date 2020-08-09.10:52:55.486>
    actor = 'scoder'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-08-09.10:52:55.486>
    closer = 'scoder'
    components = ['XML']
    creation = <Date 2018-10-18.16:22:21.351>
    creator = 'Jonathan.Gossage'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35018
    keywords = ['patch']
    message_count = 2.0
    messages = ['327982', '375066']
    nosy_count = 4.0
    nosy_names = ['scoder', 'taleinat', 'Jonathan.Gossage', 'ZackerySpytz']
    pr_nums = ['10328', '20958']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = ''
    versions = ['Python 3.10']

    Copy link
    Mannequin Author

    @jfgossage jfgossage mannequin commented Oct 18, 2018

    While working on issues bpo-6686 and bpo-9371 I realized that the solution to both involved the use of Sax lexical handlers. Unfortunately, the Python SAX parser does not expose these handlers to the end user, however, support is available in and pyexpat.c.

    What is missing is the LexicalHandler class which works the same way as the ContentHandler does for the more common handlers and provides a subclassable interface for these handlers. This class is present in the Java implementation of SAX2 and was also present in Pyxml.

    I have already verified privately that this class works exactly as expected and I am working on a PR which will provide the class along with supporting unit tests that verify that the lexical handlers work.

    @jfgossage jfgossage mannequin added 3.8 type-feature expert-XML labels Oct 18, 2018
    @ZackerySpytz ZackerySpytz mannequin added 3.10 and removed 3.8 labels Jun 18, 2020
    Copy link

    @scoder scoder commented Aug 9, 2020

    New changeset e28b8c9 by Zackery Spytz in branch 'master':
    bpo-35018: Sax parser should provide user access to lexical handlers (GH-20958)

    @scoder scoder closed this as completed Aug 9, 2020
    @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
    3.10 expert-XML type-feature
    None yet

    No branches or pull requests

    1 participant