From: Ananthu C V <weepingclown@debian.org>
Date: Sun, 8 Mar 2026 11:17:36 +0100
Subject: use raw strings to avoid syntax warnings

Last-Update: 2024-12-05
---
 doc/conf.py                                       |  2 +-
 ruffus/cmdline.py                                 |  6 ++---
 ruffus/combinatorics.py                           |  2 +-
 ruffus/parse_old_style_ruffus.py                  |  6 ++---
 ruffus/proxy_logger.py                            |  4 ++--
 ruffus/ruffus_utility.py                          |  2 +-
 ruffus/test/test_combinatorics.py                 | 28 +++++++++++------------
 ruffus/test/test_file_name_parameters.py          | 14 ++++++------
 ruffus/test/test_newstyle_combinatorics.py        | 28 +++++++++++------------
 ruffus/test/test_newstyle_regex_error_messages.py | 20 ++++++++--------
 ruffus/test/test_regex_error_messages.py          | 20 ++++++++--------
 ruffus/test/test_ruffus_utility.py                |  2 +-
 12 files changed, 67 insertions(+), 67 deletions(-)

diff --git a/doc/conf.py b/doc/conf.py
index 0b9cea2..37bf632 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -65,7 +65,7 @@ copyright = u'2009-2019 cgat-developers'
 version=ruffus.ruffus_version.__version #major.minor[.patch[.sub]]
 # The full version, without betaincluding alpha/beta/rc tags.
 import re
-release = re.subn("([\d\.]+).*", r"\1", version)[0]
+release = re.subn(r"([\d\.]+).*", r"\1", version)[0]
 print(version, release)
 
 
diff --git a/ruffus/cmdline.py b/ruffus/cmdline.py
index 46d39bc..6928035 100644
--- a/ruffus/cmdline.py
+++ b/ruffus/cmdline.py
@@ -665,7 +665,7 @@ def get_extra_options_appropriate_for_command(appropriate_option_names, extra_op
 
 # _________________________________________________________________________________________
 def handle_verbose(options):
-    """
+    r"""
     raw options.verbose is a list of specifiers
          '+'         : i.e. --verbose. This just increases the current verbosity value by 1
          '\d+'       : e.g. --verbose 6. This (re)sets the verbosity value
@@ -704,8 +704,8 @@ def handle_verbose(options):
     #
     #   Each verbosity specifier can be
     #       '+'         : i.e. --verbose. This just increases the current verbosity value by 1
-    #       '\d+'       : e.g. --verbose 6. This (re)sets the verbosity value
-    #       '\d+:\d+'   : e.g. --verbose 7:-5 The second number is the verbose_abbreviated_path
+    #       r'\d+'       : e.g. --verbose 6. This (re)sets the verbosity value
+    #       r'\d+:\d+'   : e.g. --verbose 7:-5 The second number is the verbose_abbreviated_path
     #
     for vv in options.verbose:
         mm = match_regex.match(vv)
diff --git a/ruffus/combinatorics.py b/ruffus/combinatorics.py
index 2aeed35..b2f2826 100644
--- a/ruffus/combinatorics.py
+++ b/ruffus/combinatorics.py
@@ -23,7 +23,7 @@
 #   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 #   THE SOFTWARE.
 #################################################################################
-"""
+r"""
 
 ********************************************
 :mod:`ruffus.combinatorics` -- Overview
diff --git a/ruffus/parse_old_style_ruffus.py b/ruffus/parse_old_style_ruffus.py
index 8559c72..6ad84b8 100755
--- a/ruffus/parse_old_style_ruffus.py
+++ b/ruffus/parse_old_style_ruffus.py
@@ -175,7 +175,7 @@ if __name__ == '__main__':
 
 # 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
 
-func_re = re.compile("^\s*def.*\(")
+func_re = re.compile(r"^\s*def.*\(")
 
 
 def get_decorators(line_num, decorated_lines, all_lines):
@@ -192,8 +192,8 @@ def get_decorators(line_num, decorated_lines, all_lines):
     raise Exception("Unterminated decorators %s" % (decorated_lines,))
 
 
-decorator_re = re.compile("^\s*@")
-no_white_space_re = re.compile("^[^#\s]")
+decorator_re = re.compile(r"^\s*@")
+no_white_space_re = re.compile(r"^[^#\s]")
 if __name__ == '__main__':
     line_num = 1
     last_decorated_line_num = 1
diff --git a/ruffus/proxy_logger.py b/ruffus/proxy_logger.py
index 539ed9f..0b4830a 100644
--- a/ruffus/proxy_logger.py
+++ b/ruffus/proxy_logger.py
@@ -23,7 +23,7 @@
 #   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 #   THE SOFTWARE.
 #################################################################################
-"""
+r"""
 ****************************************************************************
 Create proxy for logging for use with multiprocessing
 ****************************************************************************
@@ -320,7 +320,7 @@ class LoggingManager(multiprocessing.managers.SyncManager):
 
 
 def make_shared_logger_and_proxy(logger_factory, logger_name, args):
-    """
+    r"""
     Make a `logging <http://docs.python.org/library/logging.html>`_ object
     called "\ ``logger_name``\ " by calling ``logger_factory``\ (``args``\ )
 
diff --git a/ruffus/ruffus_utility.py b/ruffus/ruffus_utility.py
index 168c196..30c8af9 100644
--- a/ruffus/ruffus_utility.py
+++ b/ruffus/ruffus_utility.py
@@ -499,7 +499,7 @@ def regex_matches_as_dict(test_str, compiled_regex):
 #
 # _________________________________________________________________________________________
 def path_decomposition_regex_match(test_str, compiled_regex):
-    """
+    r"""
     Returns a dictionary identifying the components of a file path.
 
     This includes both the components of a path:
diff --git a/ruffus/test/test_combinatorics.py b/ruffus/test/test_combinatorics.py
index 6b3e198..ef3245c 100755
--- a/ruffus/test/test_combinatorics.py
+++ b/ruffus/test/test_combinatorics.py
@@ -385,10 +385,10 @@ class TestCombinatorics(unittest.TestCase):
         pipeline_printout(s, [check_product_merged_task],
                           verbose=5, wrap_width=10000, pipeline="main")
         self.assertTrue(re.search('Job needs update:.*Missing files.*'
-                                  '\[.*{tempdir}/a_name.tmp1, '
+                                  r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/e_name.tmp1, '
                                   '.*{tempdir}/h_name.tmp1, '
-                                  '.*{tempdir}/a_name.e_name.h_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+                                  r'.*{tempdir}/a_name.e_name.h_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
     def test_product_run(self):
         """Run product"""
@@ -460,9 +460,9 @@ class TestCombinatorics(unittest.TestCase):
         pipeline_printout(s, [check_combinations2_merged_task],
                           verbose=5, wrap_width=10000, pipeline="main")
         self.assertTrue(re.search('Job needs update:.*Missing files.*'
-                                  '\[.*{tempdir}/a_name.tmp1, '
+                                  r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+                                  r'.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
     def test_combinations2_run(self):
         """Run product"""
@@ -486,10 +486,10 @@ class TestCombinatorics(unittest.TestCase):
         pipeline_printout(s, [check_combinations3_merged_task],
                           verbose=5, wrap_width=10000, pipeline="main")
         self.assertTrue(re.search(
-            '\[.*{tempdir}/a_name.tmp1, '
+            r'\[.*{tempdir}/a_name.tmp1, '
             '.*{tempdir}/b_name.tmp1, '
             '.*{tempdir}/c_name.tmp1, '
-            '.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+            r'.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
     def test_combinations3_run(self):
         """Run product"""
@@ -513,9 +513,9 @@ class TestCombinatorics(unittest.TestCase):
         s = StringIO()
         pipeline_printout(s, [check_permutations2_merged_task],
                           verbose=5, wrap_width=10000, pipeline="main")
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
     def test_permutations2_run(self):
         """Run product"""
@@ -538,10 +538,10 @@ class TestCombinatorics(unittest.TestCase):
         s = StringIO()
         pipeline_printout(s, [check_permutations3_merged_task],
                           verbose=5, wrap_width=10000, pipeline="main")
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
                                   '.*{tempdir}/c_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
     def test_permutations3_run(self):
         """Run product"""
@@ -565,9 +565,9 @@ class TestCombinatorics(unittest.TestCase):
         s = StringIO()
         pipeline_printout(s, [check_combinations_with_replacement2_merged_task],
                           verbose=5, wrap_width=10000, pipeline="main")
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
     def test_combinations_with_replacement2_run(self):
         """Run product"""
@@ -590,10 +590,10 @@ class TestCombinatorics(unittest.TestCase):
         s = StringIO()
         pipeline_printout(s, [check_combinations_with_replacement3_merged_task],
                           verbose=5, wrap_width=10000, pipeline="main")
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
                                   '.*{tempdir}/c_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
     def test_combinations_with_replacement3_run(self):
         """Run product"""
diff --git a/ruffus/test/test_file_name_parameters.py b/ruffus/test/test_file_name_parameters.py
index e805a6a..22cf06a 100755
--- a/ruffus/test/test_file_name_parameters.py
+++ b/ruffus/test/test_file_name_parameters.py
@@ -797,7 +797,7 @@ class Test_transform_param_factory(unittest.TestCase):
         # simple 1 input, 1 output
         #
         unnamed_args = [tempdir + "/*.test",
-                        task.formatter("/(?P<name>\w+).test$"),
+                        task.formatter(r"/(?P<name>\w+).test$"),
                         ["{path[0]}/{name[0]}.output1{ext[0]}", "{path[0]}/{name[0]}.output2"], "{path[0]}/{name[0]}.output3"]
         expected_results = [
             ('DIR/f0.test', ['DIR/f0.output1.test',
@@ -1589,9 +1589,9 @@ class Test_product_param_factory(unittest.TestCase):
         # simple 1 input, 1 output
         #
         args = [[tempdir + "/a.test1", tempdir + "/b.test1"],
-                task.formatter("(?:.+/)?(?P<ID>\w+)\.(.+)"),
+                task.formatter(r"(?:.+/)?(?P<ID>\w+)\.(.+)"),
                 [tempdir + "/c.test2", tempdir + "/d.test2", tempdir + "/e.ignore"],
-                task.formatter("(?:.+/)?(?P<ID>\w+)\.(test2)"),
+                task.formatter(r"(?:.+/)?(?P<ID>\w+)\.(test2)"),
                 r"{path[0][0]}/{ID[0][0]}.{1[1][0]}.output"]
         expected_result = [
             (('DIR/a.test1', 'DIR/c.test2'), 'DIR/a.c.output'),
@@ -1630,9 +1630,9 @@ class Test_product_param_factory(unittest.TestCase):
         # (replace) inputs
         #
         #
-        paths = self.do_task_product([tempdir + "/a.test1", tempdir + "/b.test1"],                          task.formatter("(?:.+/)?(?P<ID>\w+)\.(.+)"),
+        paths = self.do_task_product([tempdir + "/a.test1", tempdir + "/b.test1"],                          task.formatter(r"(?:.+/)?(?P<ID>\w+)\.(.+)"),
                                      [tempdir + "/c.test2", tempdir + "/d.test2", tempdir +
-                                         "/e.ignore"], task.formatter("(?:.+/)?(?P<ID>\w+)\.(test2)"),
+                                         "/e.ignore"], task.formatter(r"(?:.+/)?(?P<ID>\w+)\.(test2)"),
                                      task.inputs(
                                          ("{path[0][0]}/{basename[0][0]}.testwhat1", "{path[1][0]}/{basename[1][0]}.testwhat2")),
                                      r"{path[0][0]}/{ID[0][0]}.{1[1][0]}.output")
@@ -1649,9 +1649,9 @@ class Test_product_param_factory(unittest.TestCase):
         # add inputs
         #
         #
-        paths = self.do_task_product([tempdir + "/a.test1", tempdir + "/b.test1"],                          task.formatter("(?:.+/)?(?P<ID>\w+)\.(.+)"),
+        paths = self.do_task_product([tempdir + "/a.test1", tempdir + "/b.test1"],                          task.formatter(r"(?:.+/)?(?P<ID>\w+)\.(.+)"),
                                      [tempdir + "/c.test2", tempdir + "/d.test2", tempdir +
-                                         "/e.ignore"], task.formatter("(?:.+/)?(?P<ID>\w+)\.(test2)"),
+                                         "/e.ignore"], task.formatter(r"(?:.+/)?(?P<ID>\w+)\.(test2)"),
                                      add_inputs(
                                          "{path[0][0]}/{basename[0][0]}.testwhat1", "{path[1][0]}/{basename[1][0]}.testwhat2", ),
                                      r"{path[0][0]}/{ID[0][0]}.{1[1][0]}.output")
diff --git a/ruffus/test/test_newstyle_combinatorics.py b/ruffus/test/test_newstyle_combinatorics.py
index 35af678..713e92a 100755
--- a/ruffus/test/test_newstyle_combinatorics.py
+++ b/ruffus/test/test_newstyle_combinatorics.py
@@ -397,10 +397,10 @@ class TestCombinatorics(unittest.TestCase):
         test_pipeline2.printout(
             s, [check_product_merged_task], verbose=5, wrap_width=10000)
         self.assertTrue(re.search('Job needs update:.*Missing files.*'
-                                  '\[.*{tempdir}/a_name.tmp1, '
+                                  r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/e_name.tmp1, '
                                   '.*{tempdir}/h_name.tmp1, '
-                                  '.*{tempdir}/a_name.e_name.h_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+                                  r'.*{tempdir}/a_name.e_name.h_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
     def test_product_run(self):
         """Run product"""
@@ -471,9 +471,9 @@ class TestCombinatorics(unittest.TestCase):
         test_pipeline1.printout(
             s, [check_combinations2_merged_task], verbose=5, wrap_width=10000)
         self.assertTrue(re.search('Job needs update:.*Missing files.*'
-                                  '\[.*{tempdir}/a_name.tmp1, '
+                                  r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+                                  r'.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
     def test_combinations2_run(self):
         """Run product"""
@@ -497,10 +497,10 @@ class TestCombinatorics(unittest.TestCase):
         test_pipeline2.printout(
             s, [check_combinations3_merged_task], verbose=5, wrap_width=10000)
         self.assertTrue(re.search(
-            '\[.*{tempdir}/a_name.tmp1, '
+            r'\[.*{tempdir}/a_name.tmp1, '
             '.*{tempdir}/b_name.tmp1, '
             '.*{tempdir}/c_name.tmp1, '
-            '.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+            r'.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
     def test_combinations3_run(self):
         """Run product"""
@@ -524,9 +524,9 @@ class TestCombinatorics(unittest.TestCase):
         s = StringIO()
         test_pipeline2.printout(
             s, [check_permutations2_merged_task], verbose=5, wrap_width=10000)
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
     def test_permutations2_run(self):
         """Run product"""
@@ -549,10 +549,10 @@ class TestCombinatorics(unittest.TestCase):
         s = StringIO()
         test_pipeline2.printout(
             s, [check_permutations3_merged_task], verbose=5, wrap_width=10000)
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
                                   '.*{tempdir}/c_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
     def test_permutations3_run(self):
         """Run product"""
@@ -576,9 +576,9 @@ class TestCombinatorics(unittest.TestCase):
         s = StringIO()
         test_pipeline2.printout(
             s, [check_combinations_with_replacement2_merged_task], verbose=5, wrap_width=10000)
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
     def test_combinations_with_replacement2_run(self):
         """Run product"""
@@ -601,10 +601,10 @@ class TestCombinatorics(unittest.TestCase):
         s = StringIO()
         test_pipeline2.printout(
             s, [check_combinations_with_replacement3_merged_task], verbose=5, wrap_width=10000)
-        self.assertTrue(re.search('\[.*{tempdir}/a_name.tmp1, '
+        self.assertTrue(re.search(r'\[.*{tempdir}/a_name.tmp1, '
                                   '.*{tempdir}/b_name.tmp1, '
                                   '.*{tempdir}/c_name.tmp1, '
-                                  '.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
+                                  r'.*{tempdir}/a_name.b_name.c_name.tmp2\]'.format(tempdir=tempdir), s.getvalue()))
 
     def test_combinations_with_replacement3_run(self):
         """Run product"""
diff --git a/ruffus/test/test_newstyle_regex_error_messages.py b/ruffus/test/test_newstyle_regex_error_messages.py
index a10cfa7..b1e7446 100755
--- a/ruffus/test/test_newstyle_regex_error_messages.py
+++ b/ruffus/test/test_newstyle_regex_error_messages.py
@@ -307,7 +307,7 @@ class Test_regex_error_messages(unittest.TestCase):
         test_pipeline.printout(s, [check_regex_task],
                                verbose=5, wrap_width=10000)
         self.assertTrue(re.search(
-            'Missing files.*\[{tempdir}/a_name.tmp1, {tempdir}/a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+            r'Missing files.*\[{tempdir}/a_name.tmp1, {tempdir}/a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
     def test_regex_run(self):
         """Run transform(...,regex()...)"""
@@ -349,7 +349,7 @@ class Test_regex_error_messages(unittest.TestCase):
         test_pipeline.printout(
             s, [check_suffix_task], verbose=5, wrap_width=10000)
         self.assertTrue(re.search(
-            'Missing files.*\[{tempdir}/a_name.tmp1, {tempdir}/a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+            r'Missing files.*\[{tempdir}/a_name.tmp1, {tempdir}/a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
     def test_suffix_run(self):
         """Run transform(...,suffix()...)"""
@@ -367,12 +367,12 @@ class Test_regex_error_messages(unittest.TestCase):
         cleanup_tmpdir()
         s = StringIO()
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                pipeline_printout,
                                s, [check_suffix_unmatched_task],
                                verbose=3)
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                test_pipeline.run,
                                [check_suffix_unmatched_task], verbose=0, multiprocess=parallelism)
 
@@ -406,12 +406,12 @@ class Test_regex_error_messages(unittest.TestCase):
         cleanup_tmpdir()
         s = StringIO()
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                test_pipeline.printout,
                                s, [check_regex_misspelt_capture_error_task],
                                verbose=3)
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                test_pipeline.run,
                                [check_regex_misspelt_capture_error_task], verbose=0)
 
@@ -423,12 +423,12 @@ class Test_regex_error_messages(unittest.TestCase):
         cleanup_tmpdir()
         s = StringIO()
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                test_pipeline.printout,
                                s, [check_regex_misspelt_capture2_error_task],
                                verbose=3)
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                test_pipeline.run,
                                [check_regex_misspelt_capture2_error_task], verbose=0, multiprocess=parallelism)
 
@@ -441,12 +441,12 @@ class Test_regex_error_messages(unittest.TestCase):
         cleanup_tmpdir()
         s = StringIO()
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                test_pipeline.printout,
                                s, [check_regex_out_of_range_regex_reference_error_task],
                                verbose=3)
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                test_pipeline.run,
                                [check_regex_out_of_range_regex_reference_error_task], verbose=0, multiprocess=parallelism)
 
diff --git a/ruffus/test/test_regex_error_messages.py b/ruffus/test/test_regex_error_messages.py
index b744aae..012e896 100755
--- a/ruffus/test/test_regex_error_messages.py
+++ b/ruffus/test/test_regex_error_messages.py
@@ -299,7 +299,7 @@ class Test_regex_error_messages(unittest.TestCase):
         pipeline_printout(s, [check_regex_task], verbose=5,
                           wrap_width=10000, pipeline="main")
         self.assertTrue(re.search(
-            'Missing files.*\[{tempdir}a_name.tmp1, {tempdir}a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+            r'Missing files.*\[{tempdir}a_name.tmp1, {tempdir}a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
     def test_regex_run(self):
         """Run transform(...,regex()...)"""
@@ -341,7 +341,7 @@ class Test_regex_error_messages(unittest.TestCase):
         pipeline_printout(s, [check_suffix_task], verbose=5,
                           wrap_width=10000, pipeline="main")
         self.assertTrue(re.search(
-            'Missing files.*\[{tempdir}a_name.tmp1, {tempdir}a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
+            r'Missing files.*\[{tempdir}a_name.tmp1, {tempdir}a_name.tmp2'.format(tempdir=tempdir), s.getvalue(), re.DOTALL))
 
     def test_suffix_run(self):
         """Run transform(...,suffix()...)"""
@@ -359,12 +359,12 @@ class Test_regex_error_messages(unittest.TestCase):
         cleanup_tmpdir()
         s = StringIO()
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                pipeline_printout,
                                s, [check_suffix_unmatched_task],
                                verbose=3)
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                pipeline_run,
                                [check_suffix_unmatched_task], verbose=0, multiprocess=parallelism)
 
@@ -398,12 +398,12 @@ class Test_regex_error_messages(unittest.TestCase):
         cleanup_tmpdir()
         s = StringIO()
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                pipeline_printout,
                                s, [check_regex_misspelt_capture_error_task],
                                verbose=3)
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                pipeline_run,
                                [check_regex_misspelt_capture_error_task], verbose=0)
 
@@ -415,12 +415,12 @@ class Test_regex_error_messages(unittest.TestCase):
         cleanup_tmpdir()
         s = StringIO()
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                pipeline_printout,
                                s, [check_regex_misspelt_capture2_error_task],
                                verbose=3)
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*unknown group name",
                                pipeline_run,
                                [check_regex_misspelt_capture2_error_task], verbose=0, multiprocess=parallelism)
 
@@ -433,12 +433,12 @@ class Test_regex_error_messages(unittest.TestCase):
         cleanup_tmpdir()
         s = StringIO()
         self.assertRaisesRegex(fatal_error_input_file_does_not_match,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                pipeline_printout,
                                s, [check_regex_out_of_range_regex_reference_error_task],
                                verbose=3)
         self.assertRaisesRegex(RethrownJobError,
-                               "File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
+                               r"File '.*?' does not match regex\('.*?'\) and pattern '.*?':\n.*invalid group reference",
                                pipeline_run,
                                [check_regex_out_of_range_regex_reference_error_task], verbose=0, multiprocess=parallelism)
 
diff --git a/ruffus/test/test_ruffus_utility.py b/ruffus/test/test_ruffus_utility.py
index 1f640cd..61269b1 100755
--- a/ruffus/test/test_ruffus_utility.py
+++ b/ruffus/test/test_ruffus_utility.py
@@ -508,7 +508,7 @@ class Test_expand_nested_tasks_or_globs(unittest.TestCase):
 
 class Test_regex_replace (unittest.TestCase):
     def helper(self, data, result):
-        regex_str = "([a-z]+)\.([a-z]+)\.([a-z]+)\.([a-z]+)"
+        regex_str = r"([a-z]+)\.([a-z]+)\.([a-z]+)\.([a-z]+)"
         try_result = regex_replace("aaa.bbb.ccc.aaa",
                                    regex_str,
                                    re.compile(regex_str),
