Solaar/lib/logitech_receiver
Ken Sanislo 8a941c5553 Fix crash on exit from device cleanup during interpreter shutdown
`solaar show` (and any exit path) printed a cascade of "I/O operation
on closed file" / "sys.meta_path is None" logging errors at the bottom.

Two compounding causes:

- Device.close() was not idempotent. The CLI closes devices explicitly,
  then __del__ calls close() again during interpreter shutdown, re-running
  every device cleanup a second time. Guard with a _closed flag (not
  self.handle, which is legitimately None for receiver-paired devices).

- rgb_power.cleanup() read device.settings — the lazy property — which
  forces a first-time settings build. Running that build during shutdown
  fails because gettext can no longer import (sys.meta_path is None),
  raising inside a __del__ handler. Read the already-built settings (or
  the persister) via a new _rgb_control_off() helper that never triggers
  the build.

Either guard alone stops the crash; both are correct hardening for a
__del__-invoked path.
2026-07-31 16:36:04 -04:00
..
__init__.py
advanced_para_eq.py
base.py
base_usb.py
centurion.py
centurion_constants.py
common.py
descriptors.py device: add descriptor for K380 2026-07-04 16:10:52 -04:00
desktop_notifications.py
device.py Fix crash on exit from device cleanup during interpreter shutdown 2026-07-31 16:36:04 -04:00
device_quirks.py
diversion.py
exceptions.py
headset_rgb.py
hidpp10.py
hidpp10_constants.py
hidpp20.py debug: add warning statements to determine reason for feature request failure 2026-06-09 19:35:00 -04:00
hidpp20_constants.py
i18n.py
listener.py debug: add warning statements to determine reason for feature request failure 2026-06-09 19:35:00 -04:00
logivoice.py
notifications.py
onboard_eq.py
receiver.py receiver: close paired devices before dropping the handle 2026-07-31 16:30:39 -04:00
rgb_effects_probe.py
rgb_power.py Fix crash on exit from device cleanup during interpreter shutdown 2026-07-31 16:36:04 -04:00
settings.py
settings_new.py
settings_templates.py headset RGB: honor explicit black (0) onboard-effect colors 2026-05-21 10:13:00 -04:00
settings_validator.py
special_keys.py