From 38dedea32bc6d5e8c83d4247c1955307b080ec37 Mon Sep 17 00:00:00 2001 From: Jason Ross Date: Mon, 22 Jun 2026 19:52:56 -0500 Subject: [PATCH] Fix invalid string escape sequences Python 3.12+ emits SyntaxWarning for unrecognised backslash escapes (and these will eventually become SyntaxErrors). Convert the affected string literals to raw strings so the escapes are explicit: - scriptinterface.py: filename filter regexes (\.der, \.b64, ...). - obok.py: MAC-address detection regexes (\s, \-) and the title sanitiser ([^\s\w]). - flatxml2svg.py: the emitted JavaScript snippet contains \? and \d but also a trailing newline, so the regex part is made a raw string and the "\n" is concatenated separately. All changes are value-preserving (an unrecognised escape already evaluated to the backslash plus the character); verified the emitted JS string and the compiled regexes are unchanged, and that both plugins now compile with zero SyntaxWarnings. Co-Authored-By: Claude Opus 4.8 --- DeDRM_plugin/flatxml2svg.py | 2 +- DeDRM_plugin/scriptinterface.py | 14 +++++++------- Obok_plugin/obok/obok.py | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/DeDRM_plugin/flatxml2svg.py b/DeDRM_plugin/flatxml2svg.py index 3768358..05e7da5 100644 --- a/DeDRM_plugin/flatxml2svg.py +++ b/DeDRM_plugin/flatxml2svg.py @@ -199,7 +199,7 @@ def convert2SVG(gdict, flat_xml, pageid, previd, nextid, svgDir, raw, meta_array mlst.append('\n') mlst.append('Page %d - %s by %s\n' % (pageid, meta_array['Title'],meta_array['Authors'])) mlst.append('