diff --git a/dvc/remote/ssh/__init__.py b/dvc/remote/ssh/__init__.py index 4cc76d972..27dd81c0a 100644 --- a/dvc/remote/ssh/__init__.py +++ b/dvc/remote/ssh/__init__.py @@ -250,6 +250,8 @@ class RemoteSSH(RemoteBASE): @contextmanager def open(self, path_info, mode="r", encoding=None): + assert mode in {"r", "rt", "rb", "wb"} + with self.ssh(path_info) as ssh, closing( ssh.sftp.open(path_info.path, mode) ) as fd: