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

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

Sax parser provides no user access to lexical handlers #79199

jfgossage mannequin opened this issue Oct 18, 2018 · 2 comments
Labels
3.10 only security fixes topic-XML type-feature A feature request or enhancement

Comments

@jfgossage
Copy link
Mannequin

jfgossage mannequin commented Oct 18, 2018

BPO 35018
Nosy @scoder, @taleinat, @jfgossage, @ZackerySpytz
PRs
  • bpo-35018: Sax parser provides no user access to lexical handlers. #10328
  • bpo-35018: Sax parser provides no user access to lexical handlers #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 = 'https://github.com/jfgossage'

    bugs.python.org 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 = 'https://bugs.python.org/issue35018'
    versions = ['Python 3.10']

    @jfgossage
    Copy link
    Mannequin Author

    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 expatreader.py 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 only security fixes type-feature A feature request or enhancement topic-XML labels Oct 18, 2018
    @ZackerySpytz ZackerySpytz mannequin added 3.10 only security fixes and removed 3.8 only security fixes labels Jun 18, 2020
    @scoder
    Copy link
    Contributor

    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)
    e28b8c9

    @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
    Labels
    3.10 only security fixes topic-XML type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant