[issue19483] Pure-Python ElementTree classes no longer available since 3.3

2020-02-23 Thread Buzyboy
Change by Buzyboy : Added file: https://bugs.python.org/file48904/Screenshot_20200223-214519.png ___ Python tracker ___ ___ Python-bugs-list

[issue19483] Pure-Python ElementTree classes no longer available since 3.3

2013-11-03 Thread R. David Murray
R. David Murray added the comment: Yes, you have to do the sys.modules set at the start of your application. The python module is what gets imported, it is just that the C classes override some of the classes from the Python module when they are imported. So no, there's no way to make the pur

[issue19483] Pure-Python ElementTree classes no longer available since 3.3

2013-11-03 Thread Brecht Machiels
Brecht Machiels added the comment: > You can import the pure python version in cPython by blocking the import > of > the C accelerator: > > import sys > sys.modules['_elementtree'] = None > import xml.etree.ElementTree This will not work if xml.etree.ElementTree was already imported by an

[issue19483] Pure-Python ElementTree classes no longer available since 3.3

2013-11-03 Thread Stefan Behnel
Stefan Behnel added the comment: Brecht Machiels, 03.11.2013 11:58: > With Python 3.2, I subclassed ElementTree.XMLParser to set > ExternalEntityRefHandler on the XMLParser's (expat) 'parser' member This sounds like a request for a missing feature to me. Here is how lxml handles it: http://lxm

[issue19483] Pure-Python ElementTree classes no longer available since 3.3

2013-11-03 Thread R. David Murray
R. David Murray added the comment: It is there so that Python implementations (other than cPython) that do not have ElementTree accelerator modules can fall back on the pure python version. You can import the pure python version in cPython by blocking the import of the C accelerator: impor

[issue19483] Pure-Python ElementTree classes no longer available since 3.3

2013-11-03 Thread Brecht Machiels
New submission from Brecht Machiels: 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