mar10 / pyftpsync

Synchronize directories using FTP(S), SFTP, or file system access.
https://pyftpsync.readthedocs.io
MIT License
117 stars 25 forks source link

Unable to navigate to working directory '' (Windows) #5

Closed yanek closed 9 years ago

yanek commented 9 years ago

Both the local and remote computers are running on Windows 7. Running the script like that:

import pyftpsync.targets
import pyftpsync.ftp_target
import pyftpsync.synchronizers

local = pyftpsync.targets.FsTarget("temp")
user = "my_user"
passwd = "my_pass"
remote = pyftpsync.ftp_target.FtpTarget("/", "0.0.0.0", 18416, user, passwd)
opts = {
    "resolve": "remote",
    "verbose": 3,
    "dry_run": False
}
s = pyftpsync.synchronizers.DownloadSynchronizer(local, remote, opts)
s.run()

...and it gives me an RuntimeError:

Unable to navigate to working directory ""

Nothing changes if path = ''\\" or path = ".".

So I made a dirty and personal fix in ftp_target.py file (line 107 to 109) :

pwd = self.root_dir
# if pwd != self.root_dir:
#    raise RuntimeError("Unable to navigate to working directory %r" % self.root_dir)

Now it's working the way I wanted, but I think there may be a proper fix.

mar10 commented 9 years ago

thanks!