From 78151b3bb313fbbfb89b2389dec520b256486a18 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Sat, 4 Jul 2026 14:30:59 +0900 Subject: [PATCH] fix: update regex --- dzgui/util/redact.py | 2 +- tests/test_log_redaction.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dzgui/util/redact.py b/dzgui/util/redact.py index 2f701cd..a21b2eb 100644 --- a/dzgui/util/redact.py +++ b/dzgui/util/redact.py @@ -4,7 +4,7 @@ from typing import Literal api_filter = r"(.*&key=)([^&]*)(.*)" # FIXME: handle whitespace after directory name ($HOME root) -home_filter = r"(/home/)([^/]*)(.*)" +home_filter = r"(/home/)([^\s'\/]*)(.*)" REDACTED = r"\1REDACTED\3" REDACTION_PATTERNS = [api_filter, home_filter] diff --git a/tests/test_log_redaction.py b/tests/test_log_redaction.py index eb7d88d..a96058c 100644 --- a/tests/test_log_redaction.py +++ b/tests/test_log_redaction.py @@ -51,5 +51,4 @@ def test_log_redaction(log_error: str, expect: str) -> None: logger.critical(log_error) redacted = handler.pop() - print(redacted) assert expect == redacted