def _remote_path_isfile(sftp, remote_path): if _remote_path_exists(sftp, remote_path): mode = sftp.stat(remote_path).st_mode if stat.S_ISREG(mode) and not stat.S_ISLNK(mode): return True return False