From b4172b79ed5358f31b48f75440179814f2e0a275 Mon Sep 17 00:00:00 2001 From: hujay2019 <54535202+hujay2019@users.noreply.github.com> Date: Sun, 24 Dec 2023 16:20:25 +0800 Subject: [PATCH] Update Comment --- pysqa/ext/remote.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pysqa/ext/remote.py b/pysqa/ext/remote.py index 9f81573..d03d0df 100644 --- a/pysqa/ext/remote.py +++ b/pysqa/ext/remote.py @@ -176,7 +176,10 @@ def _transfer_files(self, file_dict, sftp=None, transfer_back=False): for file_src, file_dst in tqdm(file_dict.items()): if transfer_back: try: - sftp_client.stat(file_dst) # Check remote file existence + # Check remote file existence. + # If the remote file does not exist, sftp_client.get() will make the local file empty + # sftp_client.stat() can throw an exception early to prevent the execution of sftp_client.get(). + sftp_client.stat(file_dst) sftp_client.get(file_dst, file_src) except FileNotFoundError: pass