-
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
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.