Path Error 'Watch' and 'Staging' folders on Windows

When things doesn't work as they should.
Post Reply
Krzysztof
Posts: 7
Joined: Wed Aug 22, 2018 11:28 am

Path Error 'Watch' and 'Staging' folders on Windows

Post by Krzysztof » Thu Nov 08, 2018 10:28 am

Hello All,

On Windows, even though Mayan correctly writes the path to a 'Watch Folder' in the database in the 'sources_watchfoldersource' table - C:\Users\Krzysztof\Desktop\Mayan_Watch, the software doubles '\' and tries to find the wrong path. The message is displayed: Error processing source: [Errno 2] No such file or directory: 'C:\\Users\\Krzysztof\\Desktop\\Mayan_Watch'

It seems that Mayan is trying to find the 'Staging Folder' in the correct location, but also has a problem on Windows: Unable get list of staging files: [Errno 2] No such file or directory: 'C:\Users\Krzysztof\Desktop\Mayan_Staging'

Could you please advise how to deal with this?

Regards,
Krzysztof

User avatar
rosarior
Posts: 159
Joined: Tue Aug 21, 2018 3:28 am

Re: Path Error 'Watch' and 'Staging' folders on Windows

Post by rosarior » Thu Nov 15, 2018 6:43 am

Thanks for the report and for the diagnosis! I'll take a look at the model since this seems to be related to the way Django is storing the file path. We started implementing Pathlib (https://gitlab.com/mayan-edms/mayan-edm ... 68456b2737) to standardize how paths are manipulated. Pathlib supports Windows paths (https://docs.python.org/3/library/pathlib.html). If this is indeed an issue with the Django field type we'll subclass it and add support for Windows path if that was the case.

User avatar
rosarior
Posts: 159
Joined: Tue Aug 21, 2018 3:28 am

Re: Path Error 'Watch' and 'Staging' folders on Windows

Post by rosarior » Thu Nov 15, 2018 6:45 am

Seems like Django might have some code moved to Pathlib too (https://code.djangoproject.com/ticket/28428).

Post Reply