Skip to content

Error Parsing IF_DATA when A2L file doesn't have any if-data sections #95

@roblamoreaux

Description

@roblamoreaux

I have A2L files generated that do not have IF_DATA sections. When pya2l pulls them in to create the a2ldb file it makes an empty ifdata table and all the measurements in the if_data_associatoin table have a position field of 0.

When meas = Measurement(self.session, _mstring) is called I get the following error message

10:57:52.941 Python Error parsing IF_DATA: list index out of range

10:57:52.942 Python Error parsing IF_DATA section: '/begin IF_DATA XCP\n /begin DAQ_EVENT VARIABLE\n /begin DEFAULT_EVENT_LIST\n EVENT 0x2\n /end DEFAULT_EVENT_LIST\n /end DAQ_EVENT\n /end IF_DATA': ParsingError('Error parsing IF_DATA: list index out of range')

opening the a2ldb in python I get the following:

ifd = model.IfData()
ifd
IfData(sl = None, sc = None, el = None, ec = None, raw = None, parsed = None, rid = None)

So it seems to me there should be some error checking for no IF_DATA before trying to parse the data.

For now in my local fork I am just changing the parse code to log this as debug instead of error, but it would be nice if I didn't have to do that so I could keep my python packages up to date.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions