Skip to content

Skip malformed presenter entries in definitions files instead of crashing - #44

Open
Qrytics wants to merge 1 commit into
favalex:masterfrom
Qrytics:pilot/slot-210-fix
Open

Qrytics wants to merge 1 commit into
favalex:masterfrom
Qrytics:pilot/slot-210-fix

Conversation

@Qrytics

@Qrytics Qrytics commented Nov 10, 2026

Copy link
Copy Markdown

What

Definitions.parse_presenter crashed with an unhandled ValueError traceback when a definitions (.modbus) file contained a malformed presenter entry (a token without value=symbol, or a non-integer value).

Repro

temp i@100/2H:temp_state
:temp_state 0=OFF broken-token
ValueError: not enough values to unpack (expected 2, got 1)

Fix

Wrap per-entry parsing in try/except ValueError: log a warning naming the bad token and keep the valid entries, instead of aborting the whole file. Malformed register lines were already skipped with a warning; presenter lines now behave the same way. No dependency or behavior change beyond the crash.

Tests

  • New test_parse_malformed_presenter_entry_skipped in tests/test_definitions.py: fails before (raises ValueError), passes after.
  • Full suite: python -m pytest tests/ -q — 16 passed.

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