Closed Nikovit closed 8 years ago
Could you try to replace
if self.port:
self.ftp.connect(self.host, self.port)
else:
self.ftp.connect(self.host)
with
if self.port:
self.ftp.connect(self.host, int(self.port))
else:
self.ftp.connect(self.host)
and let us know if it works (or even create a pull request)?
does not work:
Traceback (most recent call last): File "/home/r1ka/backup.py/PostgreSQL_bacup2.py", line 102, in
s = BiDirSynchronizer(local, remote, opts) File "/home/r1ka/backup.py/ftpsync/synchronizers.py", line 535, in init super(BiDirSynchronizer, self).init(local, remote, options) File "/home/r1ka/backup.py/ftpsync/synchronizers.py", line 66, in init remote.open() File "/home/r1ka/backup.py/ftpsync/ftp_target.py", line 88, in open self.ftp.connect(self.host, int(self.port)) ValueError: invalid literal for int() with base 10: 'user'
Seems you're passing "user" instead of a port Can you post your code?
I give an example of how to http://pyftpsync.readthedocs.io/en/latest/
My code: https://github.com/Nikovit/backup/blob/master/PostgreSQL_bacup2.py
The signature is described here http://pyftpsync.readthedocs.io/en/latest/ftpsync.html#module-ftpsync.ftp_target but the tutorial was misleading: You were passing the username for the port.
I use python 3.5, the error types