Skip to content

Release 3.14.6 doesn't work when trying to list() with get_info = True #146

@eblis

Description

@eblis

Latest release available in PyPi repository (which is 3.14.6) doesn't work when you try to list() with get_info = True.
The problem is the way it tries to get the name (displayname) field, it uses | which is not undestood by the XML library.

        find_attributes = (
            ('created', ".//{DAV:}creationdate"),
            ('name', ".//{DAV:}displayname | .//{DAV:}displayName"),
            ('size', ".//{DAV:}getcontentlength"),
            ('modified', ".//{DAV:}getlastmodified"),
            ('etag', ".//{DAV:}getetag"),
            ('content_type', ".//{DAV:}getcontenttype"),
        )
        info = dict()
        for (name, value) in find_attributes:
            info[name] = response.findtext(value)
        return info

This line crashes with "Empty tag name"

response.findtext(".//{DAV:}displayname | .//{DAV:}displayName")

This is related to the PR and bug I created a while go, namely #137 and #138, but that PR had a different way of handling this, it used the name field multiple times, specifically to get around this problem with | not working.

I see that the latest code in this repository doesn't have the multiple cases for displayname which is fine for me now, the WebDAV server updated its code to be compliant (it really should be displayname, and not displayName) so you can leave the check only for displayname but it would be very nice if you could release a new version of the library on PyPi which didn't break when trying to list files with get_info = True.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions