Skip to content

unicode problem of HTML parser #2

@martinhoefling

Description

@martinhoefling

I get the following traceback:

ValueError                                Traceback (most recent call last)
/usr/lib/python2.7/dist-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
    173             else:
    174                 filename = fname
--> 175             __builtin__.execfile(filename, *where)

/home/martin/local/lib/python2.6/site-packages/python_webdav/bunch.py in <module>()
      3 cl = python_webdav.client.Client("myserver")
      4 cl.set_connection(username="martin",password="mypass")
----> 5 cl.ls()

/home/martin/local/lib/python2.6/site-packages/python_webdav/client.pyc in ls(self, path, list_format, separator, display)
    148         if not path:
    149             path  = self.connection.path
--> 150         props = self.client.get_properties(self.connection, path)
    151         property_lists = []
    152         for prop in props:

/home/martin/local/lib/python2.6/site-packages/python_webdav/connection.pyc in get_properties(self, connection, resource_uri, properties)
    327             #parser = python_webdav.parse.Parser()

    328             parser = python_webdav.parse.LxmlParser()
--> 329             parser.parse(prop_xml)
    330             properties = parser.response_objects
    331             return properties

/home/martin/local/lib/python2.6/site-packages/python_webdav/parse.py in parse(self, data)
     63 
     64         """
---> 65         data_elements = HTML(data)
     66         xml_etree = ElementTree(data_elements)
     67         all_response_elements = xml_etree.findall("//response")

/usr/lib/python2.7/dist-packages/lxml/etree.so in lxml.etree.HTML (src/lxml/lxml.etree.c:54134)()

/usr/lib/python2.7/dist-packages/lxml/etree.so in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:82659)()

ValueError: Unicode strings with encoding declaration are not supported.

Any ideas?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions