From b475dc5a20c2cb73267609c03615f311ac6f081a Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Wed, 20 May 2026 16:18:55 -0700 Subject: [PATCH] fix(lint): silence ruff B007 + S110 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - core/torrent_clients/transmission.py: rename unused loop var `attempt` to `_attempt` in the session-id renegotiation loop (B007 — loop var not used in body). - core/image_cache.py: log the cleanup exception instead of swallowing it silently (S110 — bare try/except/pass). debug level since a failed tmp unlink is non-fatal; the outer ``raise`` still propagates the original error. Full ruff sweep clean. --- core/image_cache.py | 4 ++-- core/torrent_clients/transmission.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/image_cache.py b/core/image_cache.py index 9ee0be47..040c1126 100644 --- a/core/image_cache.py +++ b/core/image_cache.py @@ -198,8 +198,8 @@ class ImageCache: except Exception: try: tmp_path.unlink(missing_ok=True) - except Exception: - pass + except Exception as cleanup_exc: + logger.debug("image_cache tmp cleanup failed: %s", cleanup_exc) raise if total <= 0: diff --git a/core/torrent_clients/transmission.py b/core/torrent_clients/transmission.py index 0cd9b47c..266bda79 100644 --- a/core/torrent_clients/transmission.py +++ b/core/torrent_clients/transmission.py @@ -98,7 +98,7 @@ class TransmissionAdapter: return None auth = (self._username, self._password) if self._username else None payload = {'method': method, 'arguments': arguments} - for attempt in range(2): + for _attempt in range(2): try: with self._session_id_lock: sid = self._session_id