[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Fri Jan 20 09:07:02 UTC 2023


The branch, master has been updated
       via  253891032ee python: Don't use deprecated escape sequences
      from  91f1567cdca s3:rpc_server/mdssvc: don't crash mdssvc_tracker_shutdown with NULL glue

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 253891032eefc3a2651a88f0aba7a619948b7642
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jan 19 08:30:19 2023 +0100

    python: Don't use deprecated escape sequences
    
    Certain escape sequences are not valid in Python string literals, and
    will eventually result in a SyntaxError.
    
    Follow up patch of 5045382c6dd04b1bae0eaaae823be908213ff079
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Fri Jan 20 09:06:49 UTC 2023 on atb-devel-224

-----------------------------------------------------------------------

Summary of changes:
 buildtools/wafsamba/configure_file.py  |  4 ++--
 buildtools/wafsamba/pkgconfig.py       |  4 ++--
 buildtools/wafsamba/samba_abi.py       | 12 ++++++------
 buildtools/wafsamba/samba_conftests.py |  2 +-
 buildtools/wafsamba/samba_headers.py   |  2 +-
 buildtools/wafsamba/samba_utils.py     |  4 ++--
 buildtools/wafsamba/symbols.py         |  4 ++--
 7 files changed, 16 insertions(+), 16 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/configure_file.py b/buildtools/wafsamba/configure_file.py
index 6ad43546249..98a58a46045 100644
--- a/buildtools/wafsamba/configure_file.py
+++ b/buildtools/wafsamba/configure_file.py
@@ -13,10 +13,10 @@ def subst_at_vars(task):
     s = task.inputs[0].read()
 
     # split on the vars
-    a = re.split('(@\w+@)', s)
+    a = re.split(r'(@\w+@)', s)
     out = []
     for v in a:
-        if re.match('@\w+@', v):
+        if re.match(r'@\w+@', v):
             vname = v[1:-1]
             if not vname in task.env and vname.upper() in task.env:
                 vname = vname.upper()
diff --git a/buildtools/wafsamba/pkgconfig.py b/buildtools/wafsamba/pkgconfig.py
index b83d5f382a5..b77bd618c89 100644
--- a/buildtools/wafsamba/pkgconfig.py
+++ b/buildtools/wafsamba/pkgconfig.py
@@ -9,12 +9,12 @@ def subst_at_vars(task):
 
     s = task.inputs[0].read()
     # split on the vars
-    a = re.split('(@\w+@)', s)
+    a = re.split(r'(@\w+@)', s)
     out = []
     done_var = {}
     back_sub = [ ('PREFIX', '${prefix}'), ('EXEC_PREFIX', '${exec_prefix}')]
     for v in a:
-        if re.match('@\w+@', v):
+        if re.match(r'@\w+@', v):
             vname = v[1:-1]
             if not vname in task.env and vname.upper() in task.env:
                 vname = vname.upper()
diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index 80643aa28d7..6a8e4bcef00 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -21,16 +21,16 @@ version_key = lambda x: list(map(int, x.split(".")))
 def normalise_signature(sig):
     '''normalise a signature from gdb'''
     sig = sig.strip()
-    sig = re.sub('^\$[0-9]+\s=\s\{(.+)\}$', r'\1', sig)
-    sig = re.sub('^\$[0-9]+\s=\s\{(.+)\}(\s0x[0-9a-f]+\s<\w+>)+$', r'\1', sig)
-    sig = re.sub('^\$[0-9]+\s=\s(0x[0-9a-f]+)\s?(<\w+>)?$', r'\1', sig)
-    sig = re.sub('0x[0-9a-f]+', '0xXXXX', sig)
+    sig = re.sub(r'^\$[0-9]+\s=\s\{(.+)\}$', r'\1', sig)
+    sig = re.sub(r'^\$[0-9]+\s=\s\{(.+)\}(\s0x[0-9a-f]+\s<\w+>)+$', r'\1', sig)
+    sig = re.sub(r'^\$[0-9]+\s=\s(0x[0-9a-f]+)\s?(<\w+>)?$', r'\1', sig)
+    sig = re.sub(r'0x[0-9a-f]+', '0xXXXX', sig)
     sig = re.sub('", <incomplete sequence (\\\\[a-z0-9]+)>', r'\1"', sig)
 
     for t in abi_type_maps:
         # we need to cope with non-word characters in mapped types
         m = t
-        m = m.replace('*', '\*')
+        m = m.replace('*', r'\*')
         if m[-1].isalnum() or m[-1] == '_':
             m += '\\b'
         if m[0].isalnum() or m[0] == '_':
@@ -41,7 +41,7 @@ def normalise_signature(sig):
 
 def normalise_varargs(sig):
     '''cope with older versions of gdb'''
-    sig = re.sub(',\s\.\.\.', '', sig)
+    sig = re.sub(r',\s\.\.\.', '', sig)
     return sig
 
 
diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py
index 2c3149c0fa2..bd309adb0dd 100644
--- a/buildtools/wafsamba/samba_conftests.py
+++ b/buildtools/wafsamba/samba_conftests.py
@@ -398,7 +398,7 @@ WriteMakefile(
 
     if section:
         man = Utils.readf(os.path.join(bdir,'Makefile'))
-        m = re.search('MAN%sEXT\s+=\s+(\w+)' % section, man)
+        m = re.search(r'MAN%sEXT\s+=\s+(\w+)' % section, man)
         if not m:
             conf.end_msg('not found', color='YELLOW')
             return
diff --git a/buildtools/wafsamba/samba_headers.py b/buildtools/wafsamba/samba_headers.py
index 3313960f5f8..78f57772a82 100644
--- a/buildtools/wafsamba/samba_headers.py
+++ b/buildtools/wafsamba/samba_headers.py
@@ -19,7 +19,7 @@ def header_install_path(header, header_path):
     return ''
 
 
-re_header = re.compile('^\s*#\s*include[ \t]*"([^"]+)"', re.I | re.M)
+re_header = re.compile(r'^\s*#\s*include[ \t]*"([^"]+)"', re.I | re.M)
 
 # a dictionary mapping source header paths to public header paths
 header_map = {}
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index 45047e18ada..a7ba2ac4d0d 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -237,10 +237,10 @@ def TO_LIST(str, delimiter=None):
 
 def subst_vars_error(string, env):
     '''substitute vars, throw an error if a variable is not defined'''
-    lst = re.split('(\$\{\w+\})', string)
+    lst = re.split(r'(\$\{\w+\})', string)
     out = []
     for v in lst:
-        if re.match('\$\{\w+\}', v):
+        if re.match(r'\$\{\w+\}', v):
             vname = v[2:-1]
             if not vname in env:
                 raise KeyError("Failed to find variable %s in %s in env %s <%s>" % (vname, string, env.__class__, str(env)))
diff --git a/buildtools/wafsamba/symbols.py b/buildtools/wafsamba/symbols.py
index a6af1ac1485..5fbc0723927 100644
--- a/buildtools/wafsamba/symbols.py
+++ b/buildtools/wafsamba/symbols.py
@@ -119,9 +119,9 @@ def find_ldd_path(bld, libname, binary):
 
 
 # some regular expressions for parsing readelf output
-re_sharedlib = re.compile(b'Shared library: \[(.*)\]')
+re_sharedlib = re.compile(rb'Shared library: \[(.*)\]')
 # output from readelf could be `Library rpath` or `Libray runpath`
-re_rpath     = re.compile(b'Library (rpath|runpath): \[(.*)\]')
+re_rpath     = re.compile(rb'Library (rpath|runpath): \[(.*)\]')
 
 def get_libs(bld, binname):
     '''find the list of linked libraries for any binary or library


-- 
Samba Shared Repository



More information about the samba-cvs mailing list