kaitai_struct_python_runtime icon indicating copy to clipboard operation
kaitai_struct_python_runtime copied to clipboard

read_bytes_term() should raise EOFError instead of Exception

Open overfl0 opened this issue 4 years ago • 0 comments

read_bytes_term() should raise EOFError instead of Exception to be consistent with read_bytes().

Btw. it's funny that found this issue 1h later than the person that has reported #40

Even if #40 is implemented using a custom class, I'd suggest having both read_bytes_term() and read_bytes() raise the same type of error.

My use case is that I'm trying to detect when the packet that I'm parsing has been truncated so it would be helpful to be able to just do except EOFError (or except kaitaistruct.EOFError) instead of having to parse the exception message.

overfl0 avatar Feb 26 '20 00:02 overfl0