Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tszip can't decompress with struct metadata #95

Open
hyanwong opened this issue Dec 14, 2024 · 0 comments
Open

Tszip can't decompress with struct metadata #95

hyanwong opened this issue Dec 14, 2024 · 0 comments

Comments

@hyanwong
Copy link
Member

hyanwong commented Dec 14, 2024

In the attached file, there is struct metadata associated with the tree sequence at the top level (a simple array). Tszip can load the .trees file, and compress it to .tsz, but then can't load the .tsz file it just made:

import tszip

ts = tszip.load("test.trees")
tszip.compress(ts, "tmp.tsz")
tszip.load("tmp.tsz")  # fails with ValueError: bytes must be in range(0, 256)

test.trees.zip

Here's the debug output

File ...tszip/compression.py:329, in decompress_zarr(root)
    327     dict_repr[key] = bytes(value).decode("utf-8")
    328 elif key.endswith("metadata"):
--> 329     dict_repr[key] = bytes(value)
    330 else:
    331     dict_repr[key] = value

ValueError: bytes must be in range(0, 256)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant