Skip to content

TypeError when empty xml elements in response #512

@aleixq

Description

@aleixq

When response is like:

<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="6" feature_name="supports_async" supported="1"/>

this code (https://github.com/vim-vdebug/vdebug/blob/master/python3/vdebug/session.py#L260 ) in must_features and maybe_features can lead to error as feature_value will be NoneType (274):

    for feature in maybe_features:
        try:
            feature_value = self.__api.feature_get(feature)
            log.Log(
                "Maybe Feature: %s = %s" % (feature, str(feature_value)),
                log.Logger.DEBUG
            )
        except dbgp.DBGPError:
            error_str = "Failed to get feature %s" % feature
            log.Log(error_str, log.Logger.DEBUG)

So we need to be sure that response (xml)text is a string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions