-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
bugSomething isn't workingSomething isn't workingfixed in upcoming releasefix will arrive with next releasefix will arrive with next release
Description
Describe the bug
In the makedirs function the path is created with help of os functions. On my Windows machine i get:
NextcloudException(status_code, reason=codes(status_code).phrase, info=info) nc_py_api._exceptions.NextcloudException: [400] Bad Request <request: MKCOL https://nextcloud.XXX.com/remote.php/dav/files/Testuser/Folder%5CSubfolder
After a short debug i found the error in the line 177 os.path.join(_path, i).
The os function inserts a \ instead of /.
My simple fix is in nc_py_api/files/files.py Line 177:
replace:
_path = os.path.join(_path, i)
with:
_path = f"{_path}/{i}"
Steps/Code to Reproduce
import nc_py_api
if __name__ == "__main__":
nc = nc_py_api.Nextcloud(nextcloud_url="your.nextcloud.com", nc_auth_user="Testuser", nc_auth_pass="Password")
nc.files.makedirs(path="/Folder/Subfolder", exist_ok=True)
exit(0)
Expected Results
It creats folders if they dont exist
Actual Results
Throws Exception
Setup configuration
nc-py-api==0.15.0
nextcloud = 29.0.4
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixed in upcoming releasefix will arrive with next releasefix will arrive with next release