From 8ad3f3502beacabc0363ff2d9d7175be0f513676 Mon Sep 17 00:00:00 2001 From: rivassec Date: Fri, 11 Sep 2026 22:19:24 -0700 Subject: [PATCH] fix(post_stats): escape backslash in punctuation-drop literal Line 46's \| is an invalid escape sequence (SyntaxWarning on every build, hard SyntaxError in a future Python). Changed to \| so it is explicitly backslash + pipe - identical drop set, warning gone. Not a raw string because the literal also contains escaped quotes. --- plugins/post_stats/post_stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/post_stats/post_stats.py b/plugins/post_stats/post_stats.py index 80cfdcd4..7347d58c 100644 --- a/plugins/post_stats/post_stats.py +++ b/plugins/post_stats/post_stats.py @@ -43,7 +43,7 @@ def calculate_stats(instance): tmp = raw_text # Process the text to remove punctuation - drop = u'.,?!@#$%^&*()_+-=\|/[]{}`~:;\'\"‘’—…“”' + drop = u'.,?!@#$%^&*()_+-=\\|/[]{}`~:;\'\"‘’—…“”' raw_text = raw_text.translate(dict((ord(c), u'') for c in drop)) # Count the words in the text