This is an automated email from the ASF dual-hosted git repository.

jaydoane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/main by this push:
     new 93715b128 Convert some regex strings to raw format
93715b128 is described below

commit 93715b128343f10915a0b09d35eeb023395d16b6
Author: Jay Doane <[email protected]>
AuthorDate: Mon Nov 27 11:34:27 2023 -0800

    Convert some regex strings to raw format
    
    Using Python 3.12.0 for `dev/run` gives these warnings:
    ```
    ❯ dev/run -a adm:pass --with-haproxy --no-eval REMSHID=1 dev/remsh
    /Users/jay/repos/couchdb/dev/run:534: SyntaxWarning: invalid escape 
sequence '\d'
      JAVA_VERSION_RE = re.compile('"(\d+\.\d+).*"')
    /Users/jay/repos/couchdb/dev/run:686: SyntaxWarning: invalid escape 
sequence '\['
      "^\[httpd\]$",
    /Users/jay/repos/couchdb/dev/run:694: SyntaxWarning: invalid escape 
sequence '\['
      "^\[native_query_servers\]$",
    ```
    This changes the strings in question to "raw" format, and eliminates
    the warnings.
---
 dev/run | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dev/run b/dev/run
index 85f8b65ef..fcafcf572 100755
--- a/dev/run
+++ b/dev/run
@@ -531,7 +531,7 @@ def boot_nouveau(ctx):
 
 
 CLOUSEAU_DIR = "clouseau"
-JAVA_VERSION_RE = re.compile('"(\d+\.\d+).*"')
+JAVA_VERSION_RE = re.compile(r'"(\d+\.\d+).*"')
 
 
 def get_java_version(java):
@@ -683,7 +683,7 @@ def maybe_check_clouseau_node_alive(ctx, idx):
 
 def hack_default_ini(ctx, node, contents):
     contents = re.sub(
-        "^\[httpd\]$",
+        r"^\[httpd\]$",
         "[httpd]\nenable = true",
         contents,
         flags=re.MULTILINE,
@@ -691,7 +691,7 @@ def hack_default_ini(ctx, node, contents):
 
     if ctx["enable_erlang_views"]:
         contents = re.sub(
-            "^\[native_query_servers\]$",
+            r"^\[native_query_servers\]$",
             "[native_query_servers]\nerlang = {couch_native_process, 
start_link, []}",
             contents,
             flags=re.MULTILINE,

Reply via email to