Skip to content

Commit

Permalink
Made the fix mentioned by @deidyomega in amnong#48
Browse files Browse the repository at this point in the history
  • Loading branch information
KaratekHD committed Sep 18, 2020
1 parent 440c613 commit c877804
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions easywebdav/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,22 @@ def prop(elem, name, default=None):


def elem2file(elem):
return File(
prop(elem, 'href'),
int(prop(elem, 'getcontentlength', 0)),
prop(elem, 'getlastmodified', ''),
prop(elem, 'creationdate', ''),
prop(elem, 'getcontenttype', ''),
)
try:
return File(
prop(elem, 'href'),
int(prop(elem, 'getcontentlength', 0)),
prop(elem, 'getlastmodified', ''),
prop(elem, 'creationdate', ''),
prop(elem, 'getcontenttype', ''),
)
except:
return File(
prop(elem, 'href'),
0,
prop(elem, 'getlastmodified', ''),
prop(elem, 'creationdate', ''),
prop(elem, 'getcontenttype', ''),
)


class OperationFailed(WebdavException):
Expand Down

0 comments on commit c877804

Please sign in to comment.