-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Hi,
I'm trying to access a webdav share via your package. The server requires Ntlm-authentication, which I handled via
httpx_ntlm. I'm stuck accessing the files from the server, neither client.info(), nor client.exists(), client.modified() etc. can be executed, although client.ls('/') lists all files. My code:
from webdav4.client import Client
from httpx_ntlm import HttpNtlmAuth
client = Client(base_url="https://server/path", auth=HttpNtlmAuth('domain\\user','password'), verify=False)
client.ls('/')
prints the following list:
[{'name': 'excel1.xlsx',
'href': 'path/excel1.xlsx',
'content_length': 55446,
'created': datetime.datetime(2022, 6, 15, 13, 6, 40, tzinfo=tzutc()),
'modified': datetime.datetime(2023, 9, 8, 10, 1, 39, tzinfo=datetime.timezone.utc),
'content_language': None,
'content_type': None,
'etag': '"{some_tag},0"',
'type': None,
'display_name': 'excel1.xlsx'},
{'name': 'excel2.xlsx',
'href': 'path/excel2.xlsx',
'content_length': 39741,
'created': datetime.datetime(2025, 4, 8, 7, 27, 7, tzinfo=tzutc()),
'modified': datetime.datetime(2025, 4, 25, 8, 24, 56, tzinfo=datetime.timezone.utc),
'content_language': None,
'content_type': None,
'etag': '"{some_tag},0"',
'type': None,
'display_name':'excel2.xlsx'},
...
{'name': 'excel_n.xlsx',
'href': 'path/excel_n.xlsx',
'content_length': 1489406,
'created': datetime.datetime(2024, 11, 7, 12, 16, 48, tzinfo=tzutc()),
'modified': datetime.datetime(2025, 3, 7, 10, 0, 7, tzinfo=datetime.timezone.utc),
'content_language': None,
'content_type': None,
'etag': '"{some_tag},0"',
'type': None,
'display_name':'excel_n.xlsx'}]
But whenever I try to access one of the listed files, e.g.
client.info(path/excel1.xlsx)
I get the following error:
~/lib/python3.12/site-packages/webdav4/client.py:358, in Client._request(self, method, path, add_trailing_slash, **kwargs)
355 http_resp = self.http.request(method, url, **kwargs)
357 if http_resp.status_code == HTTPStatus.NOT_FOUND:
--> 358 raise ResourceNotFound(path)
359 if http_resp.status_code == HTTPStatus.INSUFFICIENT_STORAGE:
360 raise InsufficientStorage(path)
ResourceNotFound: The resource path/excel1.xlsx could not be found in the server
It also tried using client.propfind() directly and the result is the same.
What am I missing?
Thanks for hints
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels