python / cpython

The Python programming language
https://www.python.org
Other
62.21k stars 29.9k forks source link

Expat Parser to supply document locator in incremental parse #41935

Open 875299f2-9592-4e96-a694-3ee74065750e opened 19 years ago

875299f2-9592-4e96-a694-3ee74065750e commented 19 years ago
BPO 1193610
Nosy @loewis, @tiran

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: ```python assignee = None closed_at = None created_at = labels = ['expert-XML', 'type-feature'] title = 'Expat Parser to supply document locator in incremental parse' updated_at = user = 'https://bugs.python.org/gazzadee' ``` bugs.python.org fields: ```python activity = actor = 'christian.heimes' assignee = 'none' closed = False closed_date = None closer = None components = ['XML'] creation = creator = 'gazzadee' dependencies = [] files = [] hgrepos = [] issue_num = 1193610 keywords = [] message_count = 2.0 messages = ['54519', '192742'] nosy_count = 3.0 nosy_names = ['loewis', 'gazzadee', 'christian.heimes'] pr_nums = [] priority = 'low' resolution = None stage = 'needs patch' status = 'languishing' superseder = None type = 'enhancement' url = 'https://bugs.python.org/issue1193610' versions = ['Python 3.4'] ```

875299f2-9592-4e96-a694-3ee74065750e commented 19 years ago

The standard Expat SAX Parser supplied with Python (xml.sax.expatreader.ExpatParser) does not set the document locator (using ContentHandler.setDocumentLocator) when you are doing an incremental parse (ie. using feed instead of parse), although it does supply the locator when you do a full parse.

Is there a reason why this is so, or is it just an oversight?

tiran commented 11 years ago

Does anybody want to work on a patch?