ssh: accept only wb mode for open

This commit is contained in:
Mr. Outis
2019-09-06 08:48:22 -05:00
parent d7da4fcd37
commit 739236eab0
+2
View File
@@ -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: