Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ls() fails on Nextcloud server #55

Open
schferbe opened this issue Nov 15, 2017 · 0 comments
Open

ls() fails on Nextcloud server #55

schferbe opened this issue Nov 15, 2017 · 0 comments

Comments

@schferbe
Copy link

When I run the ls() command with a connection to a Nextcloud server parts of my stacktrace look like this:

  File "/usr/lib/python3.6/site-packages/easywebdav/client.py", line 184, in ls
    return [elem2file(elem) for elem in tree.findall('{DAV:}response')]
  File "/usr/lib/python3.6/site-packages/easywebdav/client.py", line 184, in <listcomp>
    return [elem2file(elem) for elem in tree.findall('{DAV:}response')]
  File "/usr/lib/python3.6/site-packages/easywebdav/client.py", line 40, in elem2file
    int(prop(elem, 'getcontentlength', 0)),
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

It seems as if not content length for directories is provided. I solved the issue by changing the return statement of prop in client.py to return default if child is None or child.text is None else child.text.
I'll be submitting a pull request for this shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant