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

Error with download() and download_sync() in 3.14.6 #106

Open
TXST-ITAC-SAAS opened this issue Aug 16, 2021 · 0 comments
Open

Error with download() and download_sync() in 3.14.6 #106

TXST-ITAC-SAAS opened this issue Aug 16, 2021 · 0 comments

Comments

@TXST-ITAC-SAAS
Copy link

TXST-ITAC-SAAS commented Aug 16, 2021

Steps to reproduce

  1. docker run -it python:3.9-slim-buster bash
  2. pip3 install webdavclient3==3.14.6
  3. run script:
    from webdav3.client import Client
    options = { 'webdav_hostname': HOSTNAME, 'webdav_login': LOGIN, 'webdav_password': PASSWORD, 'webdav_root': DAVROOT, 'disable_check': True }
    client = Client(options)
    client.download(remote_path=TESTFILE,local_path="./test.txt")

Error

Traceback (most recent call last):
File "//webdav-test.py", line 13, in
client.download(remote_path=TESTFILE,local_path="./test.txt")
File "/usr/local/lib/python3.9/site-packages/webdav3/client.py", line 397, in download
self.download_file(local_path=local_path, remote_path=remote_path, progress=progress,
File "/usr/local/lib/python3.9/site-packages/webdav3/client.py", line 67, in _wrapper
res = fn(self, *args, **kw)
File "/usr/local/lib/python3.9/site-packages/webdav3/client.py", line 458, in download_file
total = int(response.headers['content-length'])
File "/usr/local/lib/python3.9/site-packages/requests/structures.py", line 54, in getitem
return self._store[key.lower()][1]
KeyError: 'content-length'

Current workaround
Force downgrade to 3.14.5: pip3 install webdavclient3==3.14.5

@TXST-ITAC-SAAS TXST-ITAC-SAAS changed the title download() broken in 3.14.6 with Python 3.9 docker image Error with download() and download_sync() in 3.14.6 Aug 17, 2021
ezhov-evgeny added a commit that referenced this issue Nov 16, 2021
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