[New-bugs-announce] [issue35018] Sax parser provides no user access to lexical handlers

Jonathan Gossage report at bugs.python.org
Thu Oct 18 12:22:21 EDT 2018


New submission from Jonathan Gossage <jgossage at gmail.com>:

While working on issues bpo-6686 and bpo-9371 I realized that the solution to both involved the use of Sax lexical handlers. Unfortunately, the Python SAX parser does not expose these handlers to the end user, however, support is available in expatreader.py and pyexpat.c.

What is missing is the LexicalHandler class which works the same way as the ContentHandler does for the more common handlers and provides a subclassable interface for these handlers. This class is present in the Java implementation of SAX2 and was also present in Pyxml.

I have already verified privately that this class works exactly as expected and I am working on a PR which will provide the class along with supporting unit tests that verify that the lexical handlers work.

----------
messages: 327982
nosy: Jonathan.Gossage, taleinat
priority: normal
severity: normal
status: open
title: Sax parser provides no user access to lexical handlers
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35018>
_______________________________________


More information about the New-bugs-announce mailing list