Skip to content

Commit 12ab2fd

Browse files
committed
fix zipstore.move
1 parent 2cd1482 commit 12ab2fd

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/zarr/storage/_zip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ async def move(self, path: Path | str) -> None:
295295
if isinstance(path, str):
296296
path = Path(path)
297297
self.close()
298-
os.makedirs(path, exist_ok=True)
298+
os.makedirs(path.parent, exist_ok=True)
299299
shutil.move(self.path, path)
300300
self.path = path
301301
await self._open()

tests/test_store/test_zip.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ def test_externally_zipped_store(self, tmp_path: Path) -> None:
138138
assert list(zipped["foo"].keys()) == list(root["foo"].keys())
139139

140140
async def test_move(self, tmp_path: Path):
141-
origin = tmp_path / "origin"
142-
destination = tmp_path / "destintion"
141+
origin = tmp_path / "origin.zip"
142+
destination = tmp_path / "some_folder" / "destination.zip"
143143

144-
store = await ZipStore.open(path=origin, mode="w")
144+
store = await ZipStore.open(path=origin, mode="a")
145145
array = create_array(store, data=np.arange(10))
146146

147147
await store.move(str(destination))

0 commit comments

Comments
 (0)