Skip to content

len(src) can only be a multiple of typesize (8). #14

@timbmg

Description

@timbmg

Hi, I am getting an odd error related to blosc2. Even sime example as the one below results in len(src) can only be a multiple of typesize (8).

from pathlib import Path
from tinydb import TinyDB
from BetterJSONStorage import BetterJSONStorage
with TinyDB(Path("out/github/test.db"), access_mode="r+", storage=BetterJSONStorage) as DB:
    DB.insert({"a": 2})

Error

  File "/Users/tim/projects/test/.venv/lib/python3.13/site-packages/BetterJSONStorage/BetterJSONStorage.py", line 162, in __file_writer
    self._handle.write(compress(dumps(self._data, **self._dump_kwargs)))
  File "/Users/tim/projects/test/.venv/lib/python3.13/site-packages/blosc2/core.py", line 158, in compress
    _check_input_length("src", len_src, typesize, _ignore_multiple_size=_ignore_multiple_size)
  File "/Users/tim/projects/test/.venv/lib/python3.13/site-packages/blosc2/core.py", line 64, in _check_input_length
    raise ValueError(f"len({input_name}) can only be a multiple of typesize ({typesize}).")

Python 3.13.1
tinydb 4.8.2
betterjsonstorage 1.3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions