From 0c72763d2a9a27a3569cd20e2f417149eb6ee08f Mon Sep 17 00:00:00 2001 From: douglas-raillard-arm Date: Thu, 18 Jun 2020 12:26:26 +0100 Subject: [PATCH] target/ssh: Fix improper use of os.path.basename() os.path.basename() can give surprising results on folder names: os.path.basename('/foo/') == '' os.path.basename(os.path.normpath('/foo/')) == 'foo' --- devlib/utils/ssh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlib/utils/ssh.py b/devlib/utils/ssh.py index 57c366b..b497a9c 100644 --- a/devlib/utils/ssh.py +++ b/devlib/utils/ssh.py @@ -464,7 +464,7 @@ class SshConnection(SshConnectionBase): # inside the destination folder, rather than merging the trees. dst = os.path.join( dst, - os.path.basename(src), + os.path.basename(os.path.normpath(src)), ) return cls._push_folder_internal(sftp, src, dst)