re.compile arguments made raw-strings for py-3.13 master
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 26 Nov 2024 15:49:32 +0000 (16:49 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 26 Nov 2024 15:49:32 +0000 (16:49 +0100)
system/Substrate.py
system/TestPlc.py
system/template-qemu/iptables.py

index 2ab6c89..d531cfb 100644 (file)
@@ -459,8 +459,8 @@ class BuildBox (Box):
         else:
             self.soft_reboot (options)
 
-build_matcher=re.compile("\s*(?P<pid>[0-9]+).*-[bo]\s+(?P<buildname>[^\s]+)(\s|\Z)")
-build_matcher_initvm=re.compile("\s*(?P<pid>[0-9]+).*initvm.*\s+(?P<buildname>[^\s]+)\s*\Z")
+build_matcher=re.compile(r"\s*(?P<pid>[0-9]+).*-[bo]\s+(?P<buildname>[^\s]+)(\s|\Z)")
+build_matcher_initvm=re.compile(r"\s*(?P<pid>[0-9]+).*initvm.*\s+(?P<buildname>[^\s]+)\s*\Z")
 
 class BuildLxcBox (BuildBox):
     def soft_reboot (self, options):
@@ -743,7 +743,7 @@ class QemuBox (Box):
             self.run_ssh(['pkill','qemu'], "Killing qemu instances",
                          dry_run=options.dry_run)
 
-    matcher=re.compile("\s*(?P<pid>[0-9]+).*-cdrom\s+(?P<nodename>[^\s]+)\.iso")
+    matcher=re.compile(r"\s*(?P<pid>[0-9]+).*-cdrom\s+(?P<nodename>[^\s]+)\.iso")
 
     def sense(self, options):
         print('qn', end=' ')
@@ -927,9 +927,9 @@ class TestBox(Box):
             self.test_instances.append(i)
         i.set_broken(plcindex, step)
 
-    matcher_proc=re.compile (".*/proc/(?P<pid>[0-9]+)/cwd.*/root/(?P<buildname>[^/]+)$")
-    matcher_grep=re.compile ("/root/(?P<buildname>[^/]+)/logs/trace.*:TRACE:\s*(?P<plcindex>[0-9]+).*step=(?P<step>\S+).*")
-    matcher_grep_missing=re.compile ("grep: /root/(?P<buildname>[^/]+)/logs/trace: No such file or directory")
+    matcher_proc=re.compile(r".*/proc/(?P<pid>[0-9]+)/cwd.*/root/(?P<buildname>[^/]+)$")
+    matcher_grep=re.compile(r"/root/(?P<buildname>[^/]+)/logs/trace.*:TRACE:\s*(?P<plcindex>[0-9]+).*step=(?P<step>\S+).*")
+    matcher_grep_missing=re.compile(r"grep: /root/(?P<buildname>[^/]+)/logs/trace: No such file or directory")
 
     def sense(self, options):
         print('tm', end=' ')
index 9cf5a2f..e7b41f6 100644 (file)
@@ -1619,7 +1619,7 @@ class TestPlc:
             return True
         utils.header("********** Regular yum failed - special workaround in place, 2nd chance")
         code, cached_rpm_path = \
-                utils.output_of(self.actual_command_in_guest('find /var/cache/yum -name sfa-client\*.rpm'))
+                utils.output_of(self.actual_command_in_guest(r'find /var/cache/yum -name sfa-client\*.rpm'))
         utils.header("rpm_path=<<{}>>".format(rpm_path))
         # just for checking
         self.run_in_guest("rpm -i {}".format(cached_rpm_path))
index d694878..ded7e17 100755 (executable)
@@ -9,9 +9,9 @@ def main():
         ip = sys.argv[3]
 
         found = False
-        lo_matcher = re.compile("\A(?P<left>.+)\s+-i\s+lo\s+-j\s+ACCEPT")
+        lo_matcher = re.compile(r"\A(?P<left>.+)\s+-i\s+lo\s+-j\s+ACCEPT")
         # what comes out of iptables-save has short-options syntax
-        ip_matcher = re.compile(".*-(s|d) %s" % ip)
+        ip_matcher = re.compile(r".*-(s|d) %s" % ip)
         for line in fin.readlines():
             attempt = lo_matcher.match(line)
             if attempt: