Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-1734

Ignore decoding issues when retrieving the path stored in xattrs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.1.4
    • Component/s: Local client

      Description

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h