If you have a non-text blob in a Python byte string (as opposed to
ASCII or UTF-8 encoded text, which is fine), you should wrap it in a
void type for storage. This will map to the HDF5 OPAQUE datatype, and
will prevent your blob from getting mangled by the string machinery.
Here’s an example of how to store binary data in an attribute, and
then recover it:
From https://h5py.readthedocs.io/en/stable/strings.html#how-to-store-raw-binary-data:
Closes https://github.com/ilastik/ilastik/issues/1997.