sanjacob/BlackboardSync

[Bug Report]: Path too long on Windows (mkdir)

Closed this issue · 5 comments

BlackboardSync Version

#399

BlackboardSync Release

Windows installer

Python Version

No response

Operating System and Version

Windows 11

University Name

Mid-State Technical College

Problem Description

Huh, got a new error from Windows:

Download error
Traceback (most recent call last):
File "pathlib.py", line 1116, in mkdir
FileNotFoundError: [WinError 206] The filename or extension is too long: 'C:\Users\Me\Documents\dl4\2024\Orientation for Courses Using Blackboard Ultra\Resources for Technology Assistance, Time Management, Study Skills, and Motivation (WIP)\Time Management Ideas\10 Time Management Skills and Techniques for Students (article)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "blackboard_sync\sync.py", line 153, in download
File "blackboard_sync\download.py", line 104, in download
File "blackboard_sync\content\course.py", line 42, in write
File "blackboard_sync\content\content.py", line 67, in write
File "blackboard_sync\content\folder.py", line 29, in write
File "blackboard_sync\content\content.py", line 67, in write
File "blackboard_sync\content\folder.py", line 29, in write
File "blackboard_sync\content\content.py", line 65, in write
File "pathlib.py", line 1121, in mkdir
File "pathlib.py", line 1116, in mkdir
FileNotFoundError: [WinError 206] The filename or extension is too long: 'C:\Users\Me\Documents\dl4\2024\Orientation for Courses Using Blackboard Ultra\Resources for Technology Assistance, Time Management, Study Skills, and Motivation (WIP)\Time Management Ideas\10 Time Management Skills and Techniques for Students (article)'

I tried to fix it with regedit by navigating to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem and edit LongPathsEnabled and set value from 0 to 1, but it didn't work. I tried to set the folder on C:/ but that did not work either.

Log File Contents

Download error
Traceback (most recent call last):
File "pathlib.py", line 1116, in mkdir
FileNotFoundError: [WinError 206] The filename or extension is too long: 'C:\dl\2024\Orientation for Courses Using Blackboard Ultra\Resources for Technology Assistance, Time Management, Study Skills, and Motivation (WIP)\Study Skills\6 Strategies for Effective Learning (borrowed from GPS for Student Success)\ultraDocumentBody'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "blackboard_sync\sync.py", line 153, in download
File "blackboard_sync\download.py", line 104, in download
File "blackboard_sync\content\course.py", line 42, in write
File "blackboard_sync\content\content.py", line 67, in write
File "blackboard_sync\content\folder.py", line 29, in write
File "blackboard_sync\content\content.py", line 67, in write
File "blackboard_sync\content\folder.py", line 29, in write
File "blackboard_sync\content\content.py", line 67, in write
File "blackboard_sync\content\folder.py", line 29, in write
File "blackboard_sync\content\content.py", line 70, in write
File "pathlib.py", line 1121, in mkdir
File "pathlib.py", line 1116, in mkdir
FileNotFoundError: [WinError 206] The filename or extension is too long: 'C:\dl\2024\Orientation for Courses Using Blackboard Ultra\Resources for Technology Assistance, Time Management, Study Skills, and Motivation (WIP)\Study Skills\6 Strategies for Effective Learning (borrowed from GPS for Student Success)\ultraDocumentBody'

I can confirm that this is not a problem on Linux.

I see #178 should have fixed it, so it might simply be my machine is configured wrong (even though it should be set). I will be testing on another machine.

@lint-os #178 only fixed the file writer, but tbh I forgot about the mkdir operation. I'll be fixing it soon.

@lint-os should be fixed now. I will be creating a pre-release soon that you can try out.
edit: Pre-release is out

That fixed it on Windows. Works great. :)
Thank you for fixing it so fast.