Hi @pradeeban, found a small bug while reading through concore_base.py's file-based read().
When the port file fails to open, FileNotFoundError is handled separately, but any other error (permission denied, reading a directory, a corrupted file that can't decode, etc.) falls into the generic except and still sets last_read_status = "FILE_NOT_FOUND", even though the file exists and something else went wrong.
Kind of defeats the purpose of read_with_status() (#390/#498), which exists so callers know why they got default data. In a control loop, "no data yet" and "something's actually broken" aren't the same thing.
Also, the docstring lists EMPTY_DATA as a possible status, but nothing in the file ever sets it. Looks like stale documentation.
tests/test_read_status.py doesn't cover this case either.
Happy to send a PR: proper status for that branch, fix the EMPTY_DATA docstring, and a regression test.
Hi @pradeeban, found a small bug while reading through
concore_base.py's file-basedread().When the port file fails to open,
FileNotFoundErroris handled separately, but any other error (permission denied, reading a directory, a corrupted file that can't decode, etc.) falls into the genericexceptand still setslast_read_status = "FILE_NOT_FOUND", even though the file exists and something else went wrong.Kind of defeats the purpose of
read_with_status()(#390/#498), which exists so callers know why they got default data. In a control loop, "no data yet" and "something's actually broken" aren't the same thing.Also, the docstring lists
EMPTY_DATAas a possible status, but nothing in the file ever sets it. Looks like stale documentation.tests/test_read_status.pydoesn't cover this case either.Happy to send a PR: proper status for that branch, fix the EMPTY_DATA docstring, and a regression test.