��diff --git a/plumbum/machines/remote.py b/plumbum/machines/remote.py index b17cb53..42ec0b5 100644 --- a/plumbum/machines/remote.py +++ b/plumbum/machines/remote.py @@ -433,7 +433,7 @@ class BaseRemoteMachine(BaseMachine): def _path_write(self, fn, data): if self.custom_encoding and isinstance(data, str): data = data.encode(self.custom_encoding) - with NamedTemporaryFile() as f: + with NamedTemporaryFile(delete_on_close=False) as f: f.write(data) f.flush() f.seek(0) diff --git a/plumbum/machines/ssh_machine.py b/plumbum/machines/ssh_machine.py index a79bd14..cc4963d 100644 --- a/plumbum/machines/ssh_machine.py +++ b/plumbum/machines/ssh_machine.py @@ -362,7 +362,6 @@ class SshMachine(BaseRemoteMachine): if isinstance(dst, RemotePath) and dst.remote != self: raise TypeError(f"dst {dst!r} points to a different remote machine") if IS_WIN32: - src = self._translate_drive_letter(src) dst = self._translate_drive_letter(dst) self._scp_command(src, f"{self._fqhost}:{shquote(dst)}")