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.

Author brechtm
Recipients brechtm, eli.bendersky, scoder
Date 2013-11-03.10:58:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1383476320.61.0.0930927196631.issue19483@psf.upfronthosting.co.za>
In-reply-to
Content
With Python 3.2, I subclassed ElementTree.XMLParser to set ExternalEntityRefHandler on the XMLParser's (expat) 'parser' member. I understand the 'parser' member is not part of the public API, but this was the only way to customize the parser without having to write a parser from scratch.

With 3.3, cElementTree replaces the Python implementation by default. Its XMLParser class has no accessible 'parser' member to configure. Unfortunately, there does not seem to be a way to use the pure-Python XMLParser, which would still allow for customization of the parser. Why is the Python version still in the library if it can't be accessed? Only for platforms where the C extension is not available?

I see two possible solutions:

1) Have XMLParser (both the C and Python versions) accept an optional parser argument, so that a custom parser can be passed in.

2) Make the Python version of ElementTree available again.

My other option is to copy the Python XMLParser version into my project. I would like to avoid this, as this would duplicate a lot of perfectly good code.
Perhaps there are other solutions?
History
Date User Action Args
2013-11-03 10:58:40brechtmsetrecipients: + brechtm, scoder, eli.bendersky
2013-11-03 10:58:40brechtmsetmessageid: <1383476320.61.0.0930927196631.issue19483@psf.upfronthosting.co.za>
2013-11-03 10:58:40brechtmlinkissue19483 messages
2013-11-03 10:58:39brechtmcreate