You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
elementtree: stop the parser more quickly on error #62933
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=Noneclosed_at=<Date2013-12-16.23:19:20.100>created_at=<Date2013-08-13.23:58:20.774>labels= ['expert-XML', 'performance']
title='elementtree: stop the parser more quickly on error'updated_at=<Date2013-12-16.23:19:20.099>user='https://github.com/vstinner'
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).
Activity
vstinner commentedon Aug 13, 2013
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).
vstinner commentedon Dec 16, 2013
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.