sigmf-python icon indicating copy to clipboard operation
sigmf-python copied to clipboard

SigMFile data_file is None from archive

Open Deschain opened this issue 1 year ago • 1 comments

SigMFFile member data_file is None when creaeting a SigMFFile from archive. This ends up raising an exception when calling get_capture_byte_boundarys due to calling path.getsize with None.

https://github.com/sigmf/sigmf-python/blob/bd260606e72dde3526bab4d30a97cc7608b1f161/sigmf/sigmffile.py#L390

I don't know if there are other cases.

Deschain avatar Sep 11 '24 12:09 Deschain

data_file being None probably leads to sample_count=0 as well, which triggers an end of file error in read_samples if count is not -1.

For sigmf==1.1.5, reading archives works fine with data_file and sample_count set correctly. For sigmf==1.2.10, reading archives results in data_file=None and sample_count=0.

lukashenneke avatar Oct 13 '25 14:10 lukashenneke