-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 4.1.2
-
Fix Version/s: 4.1.4
-
Component/s: Local client
Issue
Sentry Issue: NUXEO-DRIVE-19Y
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 8: invalid start byte File "nxdrive/engine/processor.py", line 188, in _execute File "nxdrive/client/local_client.py", line 381, in get_remote_id File "nxdrive/client/local_client.py", line 399, in get_path_remote_id Pair error
The full error is:
UnicodeDecodeError('utf-8', b'fdrpMACS', 8, 9, 'invalid start byte')
In the REPL:
>>> b'fdrpMACS' File "<stdin>", line 1 SyntaxError: bytes can only contain ASCII literal characters. >>> r'fdrpMACS' 'fdrpMACS\x80'
There is an extra \x80 character that prevent the decoding.
Fix
1. We should strip any non-utf-8 character at the end of the xattr by simply use the errors="ignore" kwarg here.
2. Add unit tests.