Fix ASCReader Crash on "Start of Measurement" Line by RitheeshBaradwaj · Pull Request #1811 · hardbyte/python-can

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ASCReader Crash on "Start of Measurement" Line #1811

Changes from all commits

Commits

File filter

Filter by extension

Conversations

Failed to load comments.

Loading

Jump to

Jump to file

Failed to load files.

Loading

Diff view
Diff view

3 changes: 2 additions & 1 deletion CONTRIBUTORS.txt

Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ Felix Nieuwenhuizen
@fjburgos
@pkess
@felixn
@Tbruno25
@Tbruno25
@RitheeshBaradwaj

5 changes: 5 additions & 0 deletions can/io/asc.py

Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ def __iter__(self) -> Generator[Message, None, None]:
)
continue

# Handle the "Start of measurement" line
if re.match(r"^\d+\.\d+\s+Start of measurement", line):
# Skip this line as it's just an indicator
continue

if not ASC_MESSAGE_REGEX.match(line):
# line might be a comment, chip status,
# J1939 message or some other unsupported event
Expand Down