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

[Windows] Use the long path prefix for Engine.download_dir

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.4
    • Fix Version/s: 4.4.2
    • Component/s: Synchronizer
    • Environment:
      Wìndows

      Description

      Issue

      Sentry Issue: NUXEO-DRIVE-21F

      FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\USER\\.nuxeo-drive\\.tmp\\ENGINE_UID\\DOC_UID\folder\looong file name.doc'
        File "nxdrive\engine\processor.py", line 276, in _execute
        File "nxdrive\engine\processor.py", line 1254, in _synchronize_remotely_created
        File "nxdrive\engine\processor.py", line 1321, in _create_remotely
        File "nxdrive\engine\processor.py", line 1078, in _download_content
        File "nxdrive\client\remote_client.py", line 759, in stream_content
        File "nxdrive\client\remote_client.py", line 335, in download
        File "pathlib.py", line 1193, in open
        File "pathlib.py", line 1046, in _opener
      

      Analysis

      This happens when the file path where to put the downloaded data is too long (> 255 chars).
      The Engine.download_dir attribute is a full path that is not "protected" with the long path prefix.

      Fix

      In Engine._set_download_dir(), the retrieved folder must be protected by calling safe_long_path() on it.
      A test must be added too.

        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 day
                1d