soapy_power icon indicating copy to clipboard operation
soapy_power copied to clipboard

soapypower/writer.py line 78 read self.header_struct struct.error: unpack requires a buffer of x bytes...

Open rbenali opened this issue 4 years ago • 0 comments

Hi, got this error when reading from an open-ended file: sopypower/writer.py line 78 in read self.header_struct struct.error: unpack requires a buffer of 59 bytes [https://github.com/xmikos/soapy_power/blob/master/soapypower/writer.py#L78] Since io.read(size) rely on the underlying OS that may signal interrupt the syscall before returning exactly that size rather than less, then keep iterating syscall reading up to filling up at least header_struct size buffer before unpacking fixed the above error... "...read syscall(,,count) it is not an error if this number is smaller than the number of bytes requested; this may happen for example because fewer bytes are actually available right now..."

rbenali avatar Nov 04 '19 07:11 rbenali