This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: parallel sftp from local to remote file creates empty directory in home path
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.8
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, sugan19
Priority: normal Keywords:

Created on 2020-06-19 05:05 by sugan19, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg371845 - (view) Author: Suganya Vijayaraghavan (sugan19) Date: 2020-06-19 05:05
I was using parallelSSHClient - copy_to_file

The code was like below,
greenlets = client.copy_file('/tmp/logs', '/home/sugan/remote_copy/', recurse=True)

From /tmp/logs, I'm copying to my home path(/home/sugan) under the name 'remote_copy'.

The copying is as expected but during copying the destination path is starting with '/' then after '/' what is the first directory (in my case it 'home') a empty directory 'home' is getting creating in my home path(/home/sugan)

output:
-rw-r--r-- 1 sugan sugan 420 Jun 19 00:15 sftp.py
drwxr-xr-x 3 sugan sugan 21  Jun 19 00:17 home

pwd: /home/sugan

Consider now my script is changed as,
greenlets = client.copy_file('/tmp/logs', '/opt/user1/remote_copy/', recurse=True)

My home path is - /home/sugan but I'm copying to /opt/user1. So now when I executed the script. The script creates a empty directory 'opt' in my home path(/home/sugan).


output:
-rw-r--r-- 1 sugan sugan 420 Jun 19 00:19 sftp.py
drwxr-xr-x 3 sugan sugan 21  Jun 19 00:22 opt

pwd: /home/sugan

So whatever destination path is given and the path startswith '/' then the first directory of the path is getting created in home path. If a same directory already exists in home path then it is ignored.

And if the destination path is a relative path from home then the parallelSSHClient.copy_file works as expected.



My concern is generally we use absolute path for all... So each an empty directory is getting created in home.
msg371846 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2020-06-19 06:21
ParallelSSH is a 3rd party library and not part of Python's standard library. Please report the issue at https://github.com/ParallelSSH/parallel-ssh/
History
Date User Action Args
2022-04-11 14:59:32adminsetgithub: 85201
2020-06-19 06:21:31christian.heimessetstatus: open -> closed

nosy: + christian.heimes
messages: + msg371846

resolution: third party
stage: resolved
2020-06-19 05:05:21sugan19create