The code did not perform a retry in case a spurious I/O error occured and failed from time to time. The logic to perform a retry was already there, but it did not handle this situation properly and returned to early.
Symptom:
> return read_device_registers(i2c_bus, reads, max_tries, timeout_ms).pop()
E IndexError: pop from empty list
.venv/lib/python3.11/site-packages/feeph/i2c/__init__.py:42: IndexError
------------------- Captured log call -------------------
WARNING i2c:__init__.py:88 [feeph.i2c] Failed to read register 0x03 (1/3): [Errno 121] Remote I/O error
The code did not perform a retry in case a spurious I/O error occured and failed from time to time. The logic to perform a retry was already there, but it did not handle this situation properly and returned to early.
Symptom: