xml.etree.ElementTree.XMLParser has no attribute '_parser' in python-3.x -


trying run code in python-3.x not work works fine in 2.7. looking in c:\python34\lib\xml\etree\elementtree.py see python3 imports c implementation of elementtree while python2 not. how can solve this? forcing elementtree not import c implementation.

from xml.etree import elementtree xml.etree.elementtree import xmlparser  class customxmlparser(xmlparser):     def __init__(self, html=0, target=none, encoding=none):         xmlparser.__init__(self, html, target, encoding)         self._parser.commenthandler = self.handle_comments      def handle_comments(self):         pass  tree = elementtree.parse(path, customxmlparser()) 

i have tried elementtree.xmltreebuilder works in python2.

thanks!


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -