diff --git a/src/hipercow/dide/mounts.py b/src/hipercow/dide/mounts.py index 4ff9452..b52ca5a 100644 --- a/src/hipercow/dide/mounts.py +++ b/src/hipercow/dide/mounts.py @@ -35,7 +35,7 @@ def remap_path(path: Path, mounts: list[Mount]) -> PathMap: raise Exception(msg) mount = pos[0] relative = path.relative_to(mount.local) - if re.match("^[A-Za-z]:/?$", str(mount.local)): + if re.match("^[A-Za-z]:/?$", str(mount.local).replace("\\", "/")): remote = mount.local elif mount.host == "qdrive": remote = Path("Q:") diff --git a/tests/dide/test_mounts.py b/tests/dide/test_mounts.py index 4d55645..f5d1f04 100644 --- a/tests/dide/test_mounts.py +++ b/tests/dide/test_mounts.py @@ -77,6 +77,7 @@ def test_throw_if_two_plausible_mounts(): def test_preserve_drive_letter_if_given(): + drive = "P:" m = [mounts.Mount("host", Path("/hostmount"), Path("P:"))] path = Path("P:/local/path") res = mounts.remap_path(path, m)