Skip to content

[Python SDK] RemoteRepo.download() raises ValueError on nested subdirectory paths #245

@DavideCatto

Description

@DavideCatto

I am encountering an issue with the Python SDK where repo.download() fails to retrieve files located in nested subdirectories (depth > 1). While the download works perfectly for files located in the root or an immediate subdirectory (e.g., Folder/file.png), it fails with a ValueError: PathDoesNotExist when attempting to download a file one level deeper (e.g., Folder/Subfolder/file.png), even though the file exists in the repository.

Code snippet reproducing the issue:

repo = RemoteRepo(
        f"{NAMESPACE}/{REPO_NAME}",
        host=HOST_ONLY,
        scheme=SCHEME
    )
branch = repo.get_branch(BRANCH)
list_fname = repo.ls("Dataset_V4.0")
repo.scan('Dataset_V4.0')
repo.download("Dataset_V4.0/image.png", "img.png", revision=branch.commit_id) # WORK!
repo.download("Dataset_V4.0/train/image.png", "img.png", revision=branch.commit_id) # ValueError: PathDoesNotExist

Expected Behavior

The download() method should correctly handle nested paths and download the file, just as it does for the shallower path.

Actual Behavior

The method raises ValueError: PathDoesNotExist, suggesting that the SDK or the Server is failing to resolve the path correctly when an additional directory level (/train/) is added. Already tested path parsing or URL encoding using urllib.parse.quote(safe_path, safe='/')

Environment

Oxen Server: Self-hosted (Docker)
Client OS: Windows
Oxen SDK Version: "0.42.5"

Metadata

Metadata

Assignees

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