diff options
-rw-r--r-- | lib/spack/spack/modules/common.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/util/path.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/spack/spack/modules/common.py b/lib/spack/spack/modules/common.py index 66fe145f35..b5e084bc0c 100644 --- a/lib/spack/spack/modules/common.py +++ b/lib/spack/spack/modules/common.py @@ -703,7 +703,7 @@ class BaseContext(tengine.Context): if os.path.exists(pkg.install_configure_args_path): with open(pkg.install_configure_args_path, "r") as args_file: - return args_file.read() + return spack.util.path.padding_filter(args_file.read()) # Returning a false-like value makes the default templates skip # the configure option section diff --git a/lib/spack/spack/util/path.py b/lib/spack/spack/util/path.py index 124e8efec6..f894f6f3d8 100644 --- a/lib/spack/spack/util/path.py +++ b/lib/spack/spack/util/path.py @@ -444,7 +444,7 @@ def padding_filter(string): r"(/{pad})+" # the padding string repeated one or more times r"(/{longest_prefix})?(?=/)" # trailing prefix of padding as path component ) - regex = regex.replace("/", os.sep) + regex = regex.replace("/", re.escape(os.sep)) regex = regex.format(pad=pad, longest_prefix=longest_prefix) _filter_re = re.compile(regex) |