Skip to content
This repository was archived by the owner on Jun 3, 2020. It is now read-only.
This repository was archived by the owner on Jun 3, 2020. It is now read-only.

Migrating to python 3 #76

@AForteCellenza

Description

@AForteCellenza

Hi,

I'm trying to make a python 3 version of this module. But i got a little problem replacing XMLtreeBuilder by XMLParser in this class:

`class ns_tracker_tree_builder(XMLParser):

def __init__(self):
    XMLParser.__init__(self)
    self._parser.StartNamespaceDeclHandler = self._start_ns
    self.namespaces = {}

def _start_ns(self, prefix, ns):
    self.namespaces[prefix] = '{' + ns + '}'`

I get this error:

Traceback (most recent call last):
File "exitwp.py", line 374, in
data = parse_wp_xml(wpe)
File "exitwp.py", line 83, in parse_wp_xml
parser = ns_tracker_tree_builder()
File "exitwp.py", line 65, in init
self._parser.StartNamespaceDeclHandler = self._start_ns
AttributeError: 'ns_tracker_tree_builder' object has no attribute '_parser'

regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions