Skip to content

GvmConnectionTestCase.test_feed_xml_error fails on macos #550

@risicle

Description

@risicle

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

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