I'm trying to upload some files with this example code:
from ftpsync.targets import FsTarget
from ftpsync.ftp_target import FtpTarget
from ftpsync.synchronizers import UploadSynchronizer
local = FsTarget("~/temp")
user ="joe"
passwd = "secret"
remote = FtpTarget("/temp", "example.com", username=user, password=passwd)
opts = {"force": False, "delete_unmatched": True, "verbose": 3, "dry_run" : False}
s = UploadSynchronizer(local, remote, opts)
s.run()
I've getting an error:
Traceback (most recent call last):..
File "upload.py", line 14, in
s.run()
File "C:\Python27\lib\site-packages\ftpsync\synchronizers.py", line 128, in run
res = self._sync_dir()
File "C:\Python27\lib\site-packages\ftpsync\synchronizers.py", line 471, in _sync_dir
self._sync_dir()
File "C:\Python27\lib\site-packages\ftpsync\synchronizers.py", line 456, in _sync_dir
self.local.flush_meta()
File "C:\Python27\lib\site-packages\ftpsync\targets.py", line 547, in flush_meta
self.cur_dir_meta.flush()
File "C:\Python27\lib\site-packages\ftpsync\targets.py", line 351, in flush
s = json.dumps(self.dir, sort_keys=True)
File "C:\Python27\lib\json__init__.py", line 251, in dumps
sort_keys=sort_keys, **kw).encode(obj)
File "C:\Python27\lib\json\encoder.py", line 209, in encode
chunks = list(chunks)
File "C:\Python27\lib\json\encoder.py", line 434, in _iterencode
for chunk in _iterencode_dict(o, _current_indent_level):
File "C:\Python27\lib\json\encoder.py", line 408, in _iterencode_dict
for chunk in chunks:
File "C:\Python27\lib\json\encoder.py", line 408, in _iterencode_dict
for chunk in chunks:
File "C:\Python27\lib\json\encoder.py", line 387, in _iterencode_dict
yield _encoder(key)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xaf in position 14: invalid start byte
I'm trying to upload some files with this example code:
I've getting an error: Traceback (most recent call last):.. File "upload.py", line 14, in
s.run()
File "C:\Python27\lib\site-packages\ftpsync\synchronizers.py", line 128, in run
res = self._sync_dir()
File "C:\Python27\lib\site-packages\ftpsync\synchronizers.py", line 471, in _sync_dir
self._sync_dir()
File "C:\Python27\lib\site-packages\ftpsync\synchronizers.py", line 456, in _sync_dir
self.local.flush_meta()
File "C:\Python27\lib\site-packages\ftpsync\targets.py", line 547, in flush_meta
self.cur_dir_meta.flush()
File "C:\Python27\lib\site-packages\ftpsync\targets.py", line 351, in flush
s = json.dumps(self.dir, sort_keys=True)
File "C:\Python27\lib\json__init__.py", line 251, in dumps
sort_keys=sort_keys, **kw).encode(obj)
File "C:\Python27\lib\json\encoder.py", line 209, in encode
chunks = list(chunks)
File "C:\Python27\lib\json\encoder.py", line 434, in _iterencode
for chunk in _iterencode_dict(o, _current_indent_level):
File "C:\Python27\lib\json\encoder.py", line 408, in _iterencode_dict
for chunk in chunks:
File "C:\Python27\lib\json\encoder.py", line 408, in _iterencode_dict
for chunk in chunks:
File "C:\Python27\lib\json\encoder.py", line 387, in _iterencode_dict
yield _encoder(key)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xaf in position 14: invalid start byte