Open
Description
On macos 10.15, python-gvm 21.6.0, lxml 4.6.3:
__________________ GvmConnectionTestCase.test_feed_xml_error ___________________
self = <tests.connections.test_gvm_connection.GvmConnectionTestCase testMethod=test_feed_xml_error>
def test_feed_xml_error(self):
connection = GvmConnection()
connection._start_xml()
with self.assertRaises(
GvmError, msg='Cannot parse XML response. Response data read bla'
):
> connection._feed_xml("bla")
tests/connections/test_gvm_connection.py:58:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
gvm/connections.py:83: in _feed_xml
self._parser.feed(data)
src/lxml/parser.pxi:1256: in lxml.etree._FeedParser.feed
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> ???
E lxml.etree.ParserError: Unicode parsing is not supported on this platform
src/lxml/parser.pxi:1291: ParserError
I think all that needs to be done here is feed "bla"
in as a bytestring instead of a unicode string, because of https://lxml.de/FAQ.html#why-can-t-lxml-parse-my-xml-from-unicode-strings
Metadata
Metadata
Assignees
Labels
No labels