Skip to content

client.check works but client.info can't find the remote file #22

@chross

Description

@chross

The following code is working

  client.check(remote_path) #returns true (file is present)
  client.list() #lists all files correctly

but the following statements won't work

    print(client.info("0000249385.zip").size)
    print(client.info(remote_path))

The whole code:

def downloadFile(id):
    remote_path = id + ".zip"
    local_path = "C:/User/i/Desktop/" + id + ".zip"
    
    import webdav.client as wc

    options = {
     'webdav_hostname': "https://server.com:8081/Testfolder/",
     'webdav_login':    "user",
     'webdav_password': 'password'
    }
    client = wc.Client(options)
    client.webdav.is_valid()
    client.default_options['SSL_VERIFYPEER'] = False 
    client.default_options['SSL_VERIFYHOST'] = False
    #this statement list all files correctly
    print(client.list())
    #returns true (as expected)
    print(client.check(remote_path))

The error from the Python IDLE console

===== RESTART: C:/Users/i/AppData/Local/Programs/Python/Python36/test.py =====
['Testfolder/', '@Recycle/', '0000249385.zip', 'index.txt']
Traceback (most recent call last):
  File "C:/Users/i/AppData/Local/Programs/Python/Python36/test.py", line 62, in <module>
    downloadFile("0000249385")
  File "C:/Users/i/AppData/Local/Programs/Python/Python36/test.py", line 21, in downloadFile
    print(client.info("0000249385.zip").size)
  File "C:\Users\i\AppData\Local\Programs\Python\Python36\lib\site-packages\webdav\client.py", line 803, in info
    return parse(response, path)
  File "C:\Users\i\AppData\Local\Programs\Python\Python36\lib\site-packages\webdav\client.py", line 776, in parse
    raise RemoteResourceNotFound(path)
webdav.exceptions.RemoteResourceNotFound: Remote resource: /0000249385.zip not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions