You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an MF4 file from Kvaser that causes the following stack trace when run:
Traceback (most recent call last):
File "load.py", line 43, in <module>
sys.exit(main(args))
File "load.py", line 27, in main
for msg in can.LogReader(args.mf4_file):
File "/home/john/.pyenv/versions/3.8.20/lib/python3.8/heapq.py", line 373, in merge
value = next()
File "/home/john/tmp/keep_1y/python-can/can/io/mf4.py", line 410, in __iter__
kv["data"] = data["CAN_ErrorFrame.DataBytes"][i][
IndexError: invalid index to scalar variable.
The test code is essentially:
for msg in can.LogReader(mf4_file):
if msg.is_error_frame:
count["error"] += 1
else:
count["other"] += 1
I put some debug at site of the error (line 407 of can/io/mf4.py):
Describe the bug
We have an MF4 file from Kvaser that causes the following stack trace when run:
The test code is essentially:
I put some debug at site of the error (line 407 of
can/io/mf4.py
):2^24?
To Reproduce
I was unable to create a file with python-can with the error data.
Expected behavior
No crash. :)
Additional context
OS and version: Linux
Python version: 3.8.20
python-can version: 654a02a 2024-11-28 | Changelog for v4.5.0 (#1897) (HEAD -> main, origin/main, origin/HEAD)
python-can interface/s (if applicable): None
Traceback and logs
If I make this hack it consumes the error frame:
The text was updated successfully, but these errors were encountered: