diff --git a/src/utils.py b/src/utils.py index cc5af3dc8..346f8062e 100755 --- a/src/utils.py +++ b/src/utils.py @@ -219,6 +219,7 @@ def perlReToReplacer(s): replacement. """ (kind, regexp, replace, flags) = nonEscapedSlashes.split(s) + replace = replace.replace('\\/', '/') if kind != 's': raise ValueError, 'Invalid kind: must be "s"' g = False diff --git a/test/test_utils.py b/test/test_utils.py index 0d12d6dc1..a30a2d5fd 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -134,6 +134,8 @@ class UtilsTest(unittest.TestCase): self.assertEqual(f('fooba/rba/z'), 'foorz') f = utils.perlReToReplacer('s/cat/dog/i') self.assertEqual(f('CATFISH'), 'dogFISH') + f = utils.perlReToReplacer('s/foo/foo\/bar/') + self.assertEqual(f('foo'), 'foo/bar') def testFindBinaryInPath(self): if os.name == 'posix':