-
Notifications
You must be signed in to change notification settings - Fork 94
Description
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 infoThis 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.