Opened 10 years ago

Closed 7 years ago

#40 closed defect (worksforme)

ftp_sync misses path separator from target directory

Reported by: ftputiluser Owned by: schwa
Priority: minor Milestone:
Component: Library Version:
Keywords: sync, target directory, path separator Cc:


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


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


Change History (3)

comment:1 Changed 10 years ago by schwa

Keywords: sync target directory path separator added
Status: newassigned
Summary: ftp_sync directoryftp_sync misses path separator from target directory

comment:2 Changed 10 years ago by schwa


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".)

comment:3 Changed 7 years ago by schwa

Resolution: worksforme
Status: assignedclosed

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.

Note: See TracTickets for help on using tickets.