This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: elementtree: stop the parser more quickly on error
Type: performance Stage:
Components: XML Versions: Python 3.4
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: fdrake, vstinner
Priority: normal Keywords:

Created on 2013-08-13 23:58 by vstinner, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg195110 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-08-13 23:58
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 #18501 (_elementtree.c calls Python callbacks while a Python exception is set).
msg206390 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-12-16 23:19
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.
History
Date User Action Args
2022-04-11 14:57:49adminsetgithub: 62933
2013-12-16 23:19:20vstinnersetstatus: open -> closed
resolution: wont fix
messages: + msg206390
2013-08-13 23:58:20vstinnercreate