From a23b2f94c0673947964235fb6beb0efed11d4bb8 Mon Sep 17 00:00:00 2001 From: Simandan Andrei-Cristian <38005199+cristii006@users.noreply.github.com> Date: Mon, 17 May 2021 12:19:35 +0300 Subject: [PATCH] Fix for longpath names in windows (#385) --- src/SSHLibrary/abstractclient.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/SSHLibrary/abstractclient.py b/src/SSHLibrary/abstractclient.py index d3f0c22ff..52a4c9b37 100644 --- a/src/SSHLibrary/abstractclient.py +++ b/src/SSHLibrary/abstractclient.py @@ -278,7 +278,7 @@ def login_with_public_key(self, username, keyfile, password, allow_agent=False, username = self._encode(username) if keyfile: self._verify_key_file(keyfile) - keep_alive_interval = int(TimeEntry(keep_alive_interval).value) + keep_alive_interval = int(TimeEntry(keep_alive_interval).value) try: self._login_with_public_key(username, keyfile, password, allow_agent, look_for_keys, @@ -981,7 +981,10 @@ def build_destination(self, source, destination, path_separator): :return: A new destination path. """ if os.path.exists(destination) or destination == '.': - return destination + path_separator + self.get_parent_folder(source, path_separator) + fullpath_destination = os.path.join(destination, self.get_parent_folder(source, path_separator)) + if not os.path.exists(fullpath_destination): + os.makedirs(fullpath_destination) + return fullpath_destination else: return destination