Skip to content

Commit

Permalink
Fix for longpath names in windows (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristii006 authored May 17, 2021
1 parent 7f31188 commit a23b2f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/SSHLibrary/abstractclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit a23b2f9

Please sign in to comment.