Skip to content

Fix ASC reader dropping the first frame after header comments - #2137

Open
zhaojiale2021 wants to merge 1 commit into
hardbyte:mainfrom
zhaojiale2021:fix/asc-first-data-line
Open

zhaojiale2021 wants to merge 1 commit into
hardbyte:mainfrom
zhaojiale2021:fix/asc-first-data-line

Conversation

@zhaojiale2021

Copy link
Copy Markdown

Summary

ASCReader._extract_header() currently consumes the first data line when it follows header metadata or a version comment. The line is not an ASC header field, but it is not rewound for __iter__(), so the first frame is silently lost.

Changes

  • Rewind the text stream to the first non-header data line.
  • Add a regression test for a CANoe-style version comment immediately followed by a frame.

Testing

  • python -m pytest -q test/logformats_test.py -k "first_message_after_header_comment"

Preserve the file position for a first data line encountered while parsing ASC header metadata so __iter__ processes it instead of consuming it. Add a regression test with CANoe-style version comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant