zarr-python icon indicating copy to clipboard operation
zarr-python copied to clipboard

Duplicate name: '.zattrs' when saving to ZipStore

Open jwrth opened this issue 11 months ago • 2 comments

Zarr version

2.16.1

Numcodecs version

0.11.0

Python Version

3.9.18

Operating System

Windows

Installation

pip install zarr

Description

Hi,

when I write a zarr.zip file using ZipStore and try to stepwise add new key and value pairs to .attrs I get a UserWarning and end up with multiple .zattrs files where each represents the state of the object after each manipulation event. If I write to a normal zarr directory, this does not happend and I end up with one .zattrs file containing all keys and values as I would expect.

Any ideas how to solve this? Thanks a lot in advance!

Best, Johannes

Steps to reproduce

import zarr
with zarr.ZipStore("testout.zarr.zip", mode="a") as zipstore:
    store = zarr.open(zipstore, mode="a")
    store.attrs["foo"] = "heyho"
    store.attrs["test"] = "check"

Error:

[\lib\zipfile.py:1514](file:/lib/zipfile.py:1514): UserWarning: Duplicate name: '.zattrs'
  return self._open_to_write(zinfo, force_zip64=force_zip64)

Additional output

No response

jwrth avatar Mar 06 '24 15:03 jwrth