Skip to content

Commit

Permalink
Fix for revision with /
Browse files Browse the repository at this point in the history
  • Loading branch information
mariosasko committed Apr 6, 2023
1 parent 4a7ec33 commit efa3d92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/huggingface_hub/hf_file_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class HfFileSystemResolvedPath:

def unresolve(self):
path = (
f"{REPO_TYPES_URL_PREFIXES.get(self.repo_type, '') + self.repo_id}@{self.revision}/{self.path_in_repo}"
f"{REPO_TYPES_URL_PREFIXES.get(self.repo_type, '') + self.repo_id}@{quote(self.revision, safe='')}/{self.path_in_repo}"
.rstrip("/")
)
return path
Expand Down Expand Up @@ -257,7 +257,7 @@ def ls(
except EntryNotFoundError:
if "/" in resolved_path.path_in_repo:
tree_path = self._parent(path)
tree_iter = self._iter_tree(tree_path)
tree_iter = self._iter_tree(tree_path, revision=resolved_path.revision)
else:
raise
else:
Expand Down

0 comments on commit efa3d92

Please sign in to comment.