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

Error with UnicodeDecode #351

Open
namepunk opened this issue Sep 28, 2015 · 7 comments
Open

Error with UnicodeDecode #351

namepunk opened this issue Sep 28, 2015 · 7 comments

Comments

@namepunk
Copy link

I have used the drive as a SAMBA file share for document folders. Folders are used by windows customers. If i try to backup this folder receive an error
_root@test:~# attic create -s -v /mnt/backup/attic::test2 /test/docs/test
/test/docs/test
Traceback (most recent call last):
File "/usr/local/bin/attic", line 3, in
main()
File "/usr/local/lib/python3.4/dist-packages/attic/archiver.py", line 730, in main
exit_code = archiver.run(sys.argv[1:])
File "/usr/local/lib/python3.4/dist-packages/attic/archiver.py", line 720, in run
return args.func(args)
File "/usr/local/lib/python3.4/dist-packages/attic/archiver.py", line 129, in do_create
self._process(archive, cache, args.excludes, args.exclude_caches, skip_inode s, path, restrict_dev)
File "/usr/local/lib/python3.4/dist-packages/attic/archiver.py", line 170, in process
archive.process_item(path, st)
File "/usr/local/lib/python3.4/dist-packages/attic/archive.py", line 375, in p rocess_item
item.update(self.stat_attrs(st, path))
File "/usr/local/lib/python3.4/dist-packages/attic/archive.py", line 370, in s tat_attrs
acl_get(path, item, st, self.numeric_owner)
File "attic/platform_linux.pyx", line 101, in attic.platform_linux.acl_get (at tic/platform_linux.c:2480)
File "attic/platform_linux.pyx", line 65, in attic.platform_linux.acl_numeric
ids (attic/platform_linux.c:1698)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 97: ordinal not in range(128)

@ThomasWaldmann
Copy link
Contributor

the problem is caused by a non-ascii access control list (maybe a user or group name with non-ascii chars).

@namepunk
Copy link
Author

I know it. I'm ready to backup without ACL but how? In documentation is not written about ACL.

@ThomasWaldmann
Copy link
Contributor

There is no attic option to switch that off. You'ld have to edit attic/platform.py so it runs into the "else" case there.

@namepunk
Copy link
Author

Thank you. It works.

@anarcat
Copy link

anarcat commented Oct 18, 2015

@namepunk can you provide the filename that triggers the crash? you should be able to see where it fails using -vv...

i wonder if it's a good idea to assume the ACLs are encoded in utf-8...

@ThomasWaldmann
Copy link
Contributor

@anarcat this is not the filename, but likely some non-ascii user or group name inside the acl.

@anarcat
Copy link

anarcat commented Oct 19, 2015

from irc://irc.freenodenet/#borg:

15:37:33 <anarcat> maybe the quick fix is to add a --acl flag that'S enabled by default
15:37:39 <anarcat> a bit like what i did with --progress
15:38:09 <anarcat> 0xd0 is        320   208   D0     Ð     LATIN CAPITAL LETTER ETH
15:38:15 <anarcat> in latin1
15:38:17 <anarcat> aka wtf
15:44:05 <ThomasWaldmann> >>> b'\xd0\x80'.decode('utf-8')
15:44:05 <ThomasWaldmann> 'Ѐ'
15:44:16 <anarcat> aaah
15:44:24 <ThomasWaldmann> or anything else following it
15:45:16 <anarcat> weird
15:46:27 <anarcat> >>> 'È'.encode('utf-8')
15:46:27 <anarcat> b'\xc3\x88'
15:46:56 <anarcat> >>> 'Ѐ'.encode('utf-8')
15:46:56 <anarcat> b'\xd0\x80'
15:47:16 <anarcat> even more clearly: >>> 'Ѐ' == 'È'
15:47:16 <anarcat> False
15:47:19 <anarcat> wtf
15:47:28 <ThomasWaldmann> hehe
15:47:40 <ThomasWaldmann> scammers paradise
15:54:21 <ThomasWaldmann> >>> b'\xd0\x00'.decode('utf-8', 'backslashreplace')
15:54:21 <ThomasWaldmann> Traceback (most recent call last): File "<stdin>", line 1, in <module>
15:54:21 <ThomasWaldmann> TypeError: don't know how to handle UnicodeDecodeError in error callback
15:54:30 <ThomasWaldmann> wat?
15:58:39 <ThomasWaldmann> omg, a bug in 3.4.3
16:03:27 <ThomasWaldmann> Changed in version 3.5: The 'backslashreplace' error handlers now works with decoding and translating.
16:03:34 <ThomasWaldmann> no, brand new
16:04:23 <ThomasWaldmann> guess i want surrogatescape
16:16:15 <ThomasWaldmann> how did that code ever work
16:17:52 <ThomasWaldmann> anarcat: can you have a look at acl_use_local_uid_gid

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

3 participants