Skip to content

elementtree: stop the parser more quickly on error #62933

Closed

Description

@vstinner
BPO 18733
Nosy @freddrake, @vstinner

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 2013-12-16.23:19:20.100>
created_at = <Date 2013-08-13.23:58:20.774>
labels = ['expert-XML', 'performance']
title = 'elementtree: stop the parser more quickly on error'
updated_at = <Date 2013-12-16.23:19:20.099>
user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2013-12-16.23:19:20.099>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2013-12-16.23:19:20.100>
closer = 'vstinner'
components = ['XML']
creation = <Date 2013-08-13.23:58:20.774>
creator = 'vstinner'
dependencies = []
files = []
hgrepos = []
issue_num = 18733
keywords = []
message_count = 2.0
messages = ['195110', '206390']
nosy_count = 2.0
nosy_names = ['fdrake', 'vstinner']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = 'performance'
url = 'https://bugs.python.org/issue18733'
versions = ['Python 3.4']

Activity

  1. vstinner commented on Aug 13, 2013

    @vstinner
    MemberAuthor

    When a Python handler of a XML tag fails, the ElementTree parser continues to parse the whole document. It would be nice to stop the parser more quickly.

    The pyexpat module unregisters all handlers to fail more quickly. ElementTree may do something similar.

    Or does the expat library have a function or attribute to stop the XML parser?

    See also the issue bpo-18501 (_elementtree.c calls Python callbacks while a Python exception is set).

  2. vstinner commented on Dec 16, 2013

    @vstinner
    MemberAuthor

    No reaction from Fred Drake, I don't know how to implement it and I'm no more interested to optimize this case, so I'm closing the issue.

    Reopen it with a patch if you are interested to work on it.

  3. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions