diff options
Diffstat (limited to 'python/remote.py')
| -rw-r--r-- | python/remote.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/python/remote.py b/python/remote.py index 9e08e8e6..bce065fd 100644 --- a/python/remote.py +++ b/python/remote.py @@ -3,6 +3,7 @@ import pathlib import socket from ftplib import FTP +from io import BytesIO from paramiko import Transport, SFTPClient, RSAKey from pathlib import Path from ssh2.session import Session @@ -34,7 +35,7 @@ class FtpClient(Client): with src.open("rb") as fh: self.client.storbinary(f"STOR {dst}", fh) else: - self.client.storbinary(f"STOR {dst}", fh) + self.client.storbinary(f"STOR {dst}", BytesIO(src)) class SftpClient(Client): @@ -65,7 +66,7 @@ class SftpClient(Client): with src.open("rb") as fh: self.client.putfo(fh, dst) else: - self.client.putfo(src, dst) + self.client.putfo(BytesIO(src), dst) class SftpClient2(Client): |
