Skip to content

Tszip can't decompress with struct metadataΒ #95

@hyanwong

Description

@hyanwong

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions