From 9fa0fa281017082f46d34522248bde7c08bcaa13 Mon Sep 17 00:00:00 2001 From: Subhash Gupta Date: Wed, 4 Mar 2026 22:06:53 +0530 Subject: [PATCH] fix: replace invalid escape sequences in docstrings Replace bare \d and \S in docstrings with escaped versions \d and \S to fix DeprecationWarning: invalid escape sequence in Python 3.12+ Affected files: - application/database/db.py: line 1809 - application/web/web_main.py: line 467 --- application/database/db.py | 4 ++-- application/web/web_main.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/database/db.py b/application/database/db.py index 6c1613277..6b0190dfb 100644 --- a/application/database/db.py +++ b/application/database/db.py @@ -1806,7 +1806,7 @@ def text_search(self, text: str) -> List[Optional[cre_defs.Document]]: 'CRE:' will search for the in cre names ':[:
::]' will search for all entries of and optionally, section/subsection - '\d\d\d-\d\d\d' (two sets of 3 digits) will first try to match + '\\d\\d\\d-\\d\\d\\d' (two sets of 3 digits) will first try to match CRE ids before it performs a free text search Anything else will be a case insensitive LIKE query in the database """ @@ -1818,7 +1818,7 @@ def text_search(self, text: str) -> List[Optional[cre_defs.Document]]: node_search = ( r"(Node|(?P" + types - + "))?((:| )?(?Phttps?://\S+))?((:| )(?P.+$))?" + + r"))?((:| )?(?Phttps?://\S+))?((:| )(?P.+$))?" ) match = re.search(cre_id_search, text, re.IGNORECASE) if match: diff --git a/application/web/web_main.py b/application/web/web_main.py index 6738a0109..9350309e0 100644 --- a/application/web/web_main.py +++ b/application/web/web_main.py @@ -465,7 +465,7 @@ def text_search() -> Any: * 'CRE:' will search for the in cre names * 'Standard:[:
:subsection]' will search for all entries of and optionally, section/subsection - * '\d\d\d-\d\d\d' (two sets of 3 digits) will first try to match + * '\\d\\d\\d-\\d\\d\\d' (two sets of 3 digits) will first try to match CRE ids before it performs a free text search Anything else will be a case insensitive LIKE query in the database """