From 618e8de6b3b3f273e3bab4e414f5db807c8fc9f4 Mon Sep 17 00:00:00 2001 From: Romar Cablao Date: Thu, 25 Aug 2022 15:01:10 +0800 Subject: [PATCH] Update os validation args --- sftp_py/transfer.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sftp_py/transfer.py b/sftp_py/transfer.py index efa3da8..ee1be7a 100755 --- a/sftp_py/transfer.py +++ b/sftp_py/transfer.py @@ -87,9 +87,8 @@ def remote_download(self, remotepath, localpath, copy_hidden_files=True, copy_sy for indx, item in enumerate(dir_contents): # determine remote file separator if indx == 0: - linuxpath = '/'.join([remotepath, item]) try: - _lstat_out = self.sftp_client.lstat(linuxpath) + _lstat_out = self.sftp_client.lstat(remotepath) path_sep = '/' except: path_sep = '\\' @@ -177,9 +176,8 @@ def remote_upload(self, remotepath, localpath, copy_hidden_files=True, copy_syml else: if os.path.isfile(localpath): _localfile = os.path.split(localpath)[-1] - linuxpath = '/'.join([remotepath, _localfile]) try: - _lstat_out = self.sftp_client.lstat(linuxpath) + _lstat_out = self.sftp_client.lstat(remotepath) path_sep = '/' except: path_sep = '\\'