Skip to content

Commit 011dd0f

Browse files
moscoquerapkittenis
authored andcommitted
path fixing when copying folders from windows (#88)
Path fixing when copying folders from windows
1 parent b366c60 commit 011dd0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pssh/ssh_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def _copy_dir(self, local_dir, remote_dir, sftp):
364364
file_list = os.listdir(local_dir)
365365
for file_name in file_list:
366366
local_path = os.path.join(local_dir, file_name)
367-
remote_path = os.path.join(remote_dir, file_name)
367+
remote_path = '/'.join([remote_dir, file_name])
368368
self.copy_file(local_path, remote_path, recurse=True,
369369
sftp=sftp)
370370

@@ -454,7 +454,7 @@ def copy_remote_file(self, remote_file, local_file, recurse=False,
454454

455455
def _copy_remote_dir(self, file_list, remote_dir, local_dir, sftp):
456456
for file_name in file_list:
457-
remote_path = os.path.join(remote_dir, file_name)
457+
remote_path = '/'.join([remote_dir, file_name])
458458
local_path = os.path.join(local_dir, file_name)
459459
self.copy_remote_file(remote_path, local_path, sftp=sftp,
460460
recurse=True)

0 commit comments

Comments
 (0)