Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
martindurant committed Nov 6, 2023
1 parent 050236f commit 8939bf8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions fsspec/implementations/cached.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,9 @@ def _open(
self.save_cache()
return f

def _parent(self, path):
return self.fs._parent(path)

def hash_name(self, path: str, *args: Any) -> str:
# Kept for backward compatibility with downstream libraries.
# Ignores extra arguments, previously same_name boolean.
Expand Down
1 change: 1 addition & 0 deletions fsspec/implementations/tests/test_cached.py
Original file line number Diff line number Diff line change
Expand Up @@ -1271,3 +1271,4 @@ def test_spurious_directory_issue1410(tmpdir):
# There was a bug reported in issue #1410 in which a directory
# would be created and the next assertion would fail.
assert len(os.listdir()) == 1
assert fs._parent("/any/path") == "any" # correct for ZIP, which has no leading /
3 changes: 2 additions & 1 deletion fsspec/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,8 @@ def get_file(
os.makedirs(lpath, exist_ok=True)
return None

LocalFileSystem(auto_mkdir=True).makedirs(self._parent(lpath), exist_ok=True)
fs = LocalFileSystem(auto_mkdir=True)
fs.makedirs(fs._parent(lpath), exist_ok=True)

with self.open(rpath, "rb", **kwargs) as f1:
if outfile is None:
Expand Down

0 comments on commit 8939bf8

Please sign in to comment.