From 24be3f3ca832e6f6fbd4bf58c9d6fef7c3593096 Mon Sep 17 00:00:00 2001 From: Paulo Victor Cordeiro <146781332+pvcordeiro@users.noreply.github.com> Date: Wed, 3 Jun 2026 00:13:01 +0100 Subject: [PATCH] fix: guard uid.decode() in auto-classify warning log against str UIDs (#1472) Every other uid.decode() call in this function uses 'uid.decode() if isinstance(uid, bytes) else str(uid)' but the warning at line 832 does bare uid.decode(), crashing with AttributeError when uid is already a string. --- routes/email_pollers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/email_pollers.py b/routes/email_pollers.py index 78f74ab..fad6b09 100644 --- a/routes/email_pollers.py +++ b/routes/email_pollers.py @@ -829,7 +829,7 @@ async def _auto_summarize_pass_single(days_back: int = 1, account_id: str | None _req.post, url, json=payload, headers=req_headers, timeout=120 ) if not resp.ok: - logger.warning(f"Auto-classify {uid.decode()} HTTP {resp.status_code}: {resp.text[:200]}") + logger.warning(f"Auto-classify {uid.decode() if isinstance(uid, bytes) else str(uid)} HTTP {resp.status_code}: {resp.text[:200]}") else: rdata = resp.json() m = (rdata.get("choices") or [{}])[0].get("message", {})