amnong / easywebdav

A WebDAV Client in Python
http://pypi.python.org/pypi/easywebdav/
ISC License
207 stars 113 forks source link

OneDrive returns 302 Found on PROPFIND #31

Open dmacesic opened 9 years ago

dmacesic commented 9 years ago

Traceback (most recent call last): File "davput.py", line 24, in print webdav.ls() File "/usr/local/lib/python2.7/dist-packages/easywebdav/client.py", line 176, in ls response = self._send('PROPFIND', remote_path, (207, 301), headers=headers) File "/usr/local/lib/python2.7/dist-packages/easywebdav/client.py", line 100, in _send raise OperationFailed(method, path, expected_code, response.status_code) easywebdav.client.OperationFailed: Failed to list directory ".". Operation : PROPFIND . Expected code : 207 UNKNOWN, 301 Moved Permanently Actual code : 302 Found

The WebDAV address used is of the format: https://d.docs.live.net/(cid here)/

rtribbia commented 8 years ago

I am receiving the same error. I can cd into folders blindly if I am certain they exist but, I'd like to be able to check.

Did you find a solution?

dstaff159 commented 8 years ago

Are you calling connect with the full web address or just the part after the protocol? If found that the member initilizer of Client concatenates the protocol, host, and port together to form the baseurl.

self.baseurl = '{0}://{1}:{2}'.format(protocol, host, port)

Remove the "https//" from the host variable and it should work