Summary
The I2C lock is not released if an exception occurs during the write or read operations. If writeto_then_readfrom or writeto/readfrom_into raises an exception (e.g., I2C communication error), the bus remains locked. Wrap the I2C operations in a try-finally block to ensure unlock() is always called. This applies to _write16, _read16, and _read8 methods.
Steps to reproduce
Environment