Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bsync only supports filenames encoded in the current locale #9

Closed
ceremcem opened this issue Apr 22, 2014 · 4 comments
Closed

bsync only supports filenames encoded in the current locale #9

ceremcem opened this issue Apr 22, 2014 · 4 comments

Comments

@ceremcem
Copy link

Problem can not be clearly understood:

ceremcem@cca-erik:/media/ceremcem/zfs_zencefil$ bsync ./-.-\ cca-home+/ /media/ceremcem/7c32ca7d-fb9e-4c0b-8e89-6de320908b8b/cca-sync/-.-\ cca-home+/
Loading filelists...
Old filelist not found. Starting with empty history.
Traceback (most recent call last):
  File "/home/ceremcem/bin/bsync", line 779, in <module>
    dir2 = load_dir(ssh2, dir2name, ignores)
  File "/home/ceremcem/bin/bsync", line 403, in load_dir
    record = read_file_record(gen)
  File "/home/ceremcem/bin/bsync", line 307, in read_file_record
    i,p,t,d,s,perms = next(gen),next(gen),next(gen),next(gen),next(gen),next(gen)
  File "/home/ceremcem/bin/bsync", line 294, in fileLineIter
    charsJustRead = inputFile.read(readSize)
  File "/usr/lib/python3.3/codecs.py", line 313, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 1277: invalid start byte
@dooblem dooblem changed the title more precise error log needed bsync only supports filenames encoded in the current locale Apr 24, 2014
@dooblem
Copy link
Owner

dooblem commented Apr 24, 2014

Nice catch ceremcem,
This is clearly a bug. I've been able to reproduce it by creating non utf8 filenames on my filesystem.
I'll take a look at it.

I will try to avoid converting filenames to strings (using the current locale) and force the filenames to be kept as binary data.

The patch is not simple though.

@dooblem
Copy link
Owner

dooblem commented Apr 26, 2014

I fixed it and pushed it in a new branch.
This is the raw version: https://raw.githubusercontent.com/dooblem/bsync/exoticfiles/bsync
Can you try it and tell me if it's ok ?

@ceremcem
Copy link
Author

This branch solved the problem. I have synchronized 500 GB of local files and there is no issue with the filenames. Thanks!

@dooblem
Copy link
Owner

dooblem commented May 11, 2014

Thanks. I just merged it to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants