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

Comment/PI parsing support for ElementTree #80854

Closed
scoder opened this issue Apr 20, 2019 · 3 comments
Closed

Comment/PI parsing support for ElementTree #80854

scoder opened this issue Apr 20, 2019 · 3 comments
Assignees
Labels
3.8 only security fixes stdlib Python modules in the Lib dir topic-XML type-feature A feature request or enhancement

Comments

@scoder
Copy link
Contributor

scoder commented Apr 20, 2019

BPO 36673
Nosy @scoder, @serhiy-storchaka
PRs
  • bpo-36673: Implement comment/PI parsing support for the TreeBuilder in ElementTree. #12883
  • 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 = 'https://github.com/scoder'
    closed_at = <Date 2019-05-01.19:31:14.974>
    created_at = <Date 2019-04-20.07:33:22.803>
    labels = ['expert-XML', '3.8', 'type-feature', 'library']
    title = 'Comment/PI parsing support for ElementTree'
    updated_at = <Date 2019-05-01.20:38:32.025>
    user = 'https://github.com/scoder'

    bugs.python.org fields:

    activity = <Date 2019-05-01.20:38:32.025>
    actor = 'scoder'
    assignee = 'scoder'
    closed = True
    closed_date = <Date 2019-05-01.19:31:14.974>
    closer = 'scoder'
    components = ['Library (Lib)', 'XML']
    creation = <Date 2019-04-20.07:33:22.803>
    creator = 'scoder'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36673
    keywords = ['patch']
    message_count = 3.0
    messages = ['340565', '340566', '341228']
    nosy_count = 3.0
    nosy_names = ['scoder', 'eli.bendersky', 'serhiy.storchaka']
    pr_nums = ['12883']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue36673'
    versions = ['Python 3.8']

    @scoder
    Copy link
    Contributor Author

    scoder commented Apr 20, 2019

    The TreeBuilder in xml.etree.ElementTree ignores comments and processing instructions. It should at least have a way to pass them through, even if there is not currently a way to append comments and PIs to the tree when they appear *outside* of the root element.

    The pull parser interface would directly benefit from this, because it can then report "comment" and "pi" events.

    @scoder scoder added the 3.8 only security fixes label Apr 20, 2019
    @scoder scoder self-assigned this Apr 20, 2019
    @scoder scoder added stdlib Python modules in the Lib dir topic-XML type-feature A feature request or enhancement labels Apr 20, 2019
    @scoder
    Copy link
    Contributor Author

    scoder commented Apr 20, 2019

    This is related to bpo-9521 but not a strict duplicate, because fixing that would require actually adding comments and PIs to the tree when they are not within the root element. When they are, it's in line with the current tree model and this change will do it.

    @scoder
    Copy link
    Contributor Author

    scoder commented May 1, 2019

    New changeset 43851a2 by Stefan Behnel in branch 'master':
    bpo-36673: Implement comment/PI parsing support for the TreeBuilder in ElementTree. (bpo-12883)
    43851a2

    @scoder scoder closed this as completed May 1, 2019
    @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.8 only security fixes stdlib Python modules in the Lib dir topic-XML type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant