~sschwarzer/ftputil#40: 
ftp_sync misses path separator from target directory

target_directory = "/home/user/new"
target = ftp_sync.LocalHost()
source = ftputil.FTPHost(hostname, username, password)
syncer = ftp_sync.Syncer(source, target)
syncer.sync(source_directory, target_directory)

# this should have created /home/user/new/files
# instead it created /home/user/newfiles

Solution:

#change line 168 in ftp_sync.py
self._sync_tree(source_path, target_path + "/")

thanks,
jeram

Status
RESOLVED INVALID
Submitter
ftputiluser (unverified)
Assigned to
No-one
Submitted
14 years ago
Updated
14 years ago
Labels
bug library

schwa (unverified) 14 years ago · edit

Jeram,

thanks a lot for your report and the suggested fix. I was very busy with another project and so hadn't found the time to deal with your report. Sorry.

I'm looking into the sync code right now and wonder if applying your suggested fix might make the code break in other situations. Looking at the code I guess the problem you describe will occur if the given source directory has a slash appended but the target directory (as in your case) not.

I tried to reproduce the problem but was unable to do so. Thus, it would be very helpful if you could supply a small self-contained working example I could run to reproduce the error. Please attach it to the ticket. Thanks in advance. (I hope you're still "listening".)

schwa (unverified) 12 years ago · edit

I didn't receive any reply from the ticket author, so I'll close this ticket as "worksforme" because I couldn't reproduce the problem.

Please reopen the ticket if you have a code example which shows the bug.

Register here or Log in to comment, or comment via email.