From 5fe259e69ba27e61e613090bd00d2614b5f745e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 16 Mar 2025 16:47:33 +0100 Subject: [PATCH] Continued: - sqlite3.Row doesn't allow assigning values, so we need copy it to a dict() and then it can be modified --- daemon.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/daemon.py b/daemon.py index da2b1c4..e5bb81f 100755 --- a/daemon.py +++ b/daemon.py @@ -229,13 +229,13 @@ LIMIT ?", [ result = {} for row in list(rows): - if row["reason"] not in [None, ""]: - row["reason"] = row["reason"].replace(",", " ").replace(" ", " ") + entry = dict(row) + entry["reason"] = entry["reason"].replace(",", " ").replace(" ", " ") if entry["reason"] not in [None, ""] else None - if row["block_level"] in result: - result[row["block_level"]].append(row) + if entry["block_level"] in result: + result[entry["block_level"]].append(entry) else: - result[row["block_level"]] = [row] + result[entry["block_level"]] = [entry] return result -- 2.39.5