0

I have a binary stream (blob) that I want to use to create a .h5 file.

   with open("test.h5", mode="wb") as writer:
            writer.write(h5bin) #h5bin is the binary I received from a service

But when I try to load the h5 file, it says Unable to open file (file signature not found). Upon searching for the error it seems that the file is corrupted, so I am assuming this is not the correct way to create h5 file when I have the binary.

tomeda
  • 75
  • 1
  • 11
  • 1
    Similar error here: https://stackoverflow.com/questions/38089950/error-opening-file-in-h5py-file-signature-not-found/43607837 – Jon Feb 06 '20 at 16:02
  • 1
    It would help to have an example of the binary stream output in order to know how it is encoded. Is it a hex string? Is it a bytearray? Could you please open the created file with a hex editor and look at the first bytes and try to compare them with the expected signature of this filetype? Also, what version of python are you using? – Antonio Vázquez Blanco Feb 06 '20 at 16:05
  • 1
    have you tried `h5py`? – Tommaso Fontana Feb 06 '20 at 16:10
  • Calling it 'h5' does not make it a `HDF5` file. How are you trying to load it? – hpaulj Feb 06 '20 at 16:36

0 Answers0