Skip to content

Assertion error when trying to parse a legit CANoe generated BLF file #314

@z33kz33k

Description

@z33kz33k

I'm trying to parse a BLF using this approach:

import can
from pprint import pprint as pp

filename = "logfile.blf"
logging = can.BLFReader(filename)
logging = list(logging)
pp(logging)

and get

Traceback (most recent call last):
  File "D:\eclipse-workspace\blf2csv\pythoncan_blf2csv.py", line 7, in <module>
    logging = list(logging)
  File "C:\Users\my_user_name\AppData\Local\Python\Python36\lib\site-packages\can\io\blf.py", line 129, in __iter__
    assert header[0] == b"LOBJ", "Parse error"
AssertionError: Parse error

The file is legit (I can convert it to CSV using Vector CANoe Tool >> Log File Conversion dialog (so I can convert a single file but looked at python-can as a means to do a batch conversion of multiple log files)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions