Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Trailing space in directory name prevents downloading under Windows 10 #340

Closed
rpgrca opened this issue Mar 9, 2019 · 1 comment
Closed

Comments

@rpgrca
Copy link

rpgrca commented Mar 9, 2019

Happened in this course. It downloaded fine until lesson 3 titled "Lesson 3 If you backup the data in your own way, the important information " (note the trailing space at the end of the lesson name), then it started throwing errors like this:

[*] : Lecture(s) : (1 of 19)
[*] : Downloading (040 123991i61n712395(Introduction))
[*] : Lecture : '040 123991i61n712395(Introduction)' (download skipped).
[-] : Reason : [Errno 2] No such file or directory: 'D:\\projects\\github\\udemy-dl-master\\japanese-n2-course\\04 Lesson 3 If you backup the data in your own way the important information \\040 123991i61n712395(Introduction).mp4.part'

The downloader creates the directory without the trailing space, but when saving the file it tries to put it into a directory with the trailing space, therefore it fails. As a workaround I created the directory manually with a somewhat obscure command:

md "\\?\D:\\projects\\github\\udemy-dl-master\\japanese-n2-course\\04 Lesson 3 If you backup the data in your own way the important information "

Tested in Windows 10.

@rpgrca
Copy link
Author

rpgrca commented Mar 9, 2019

Debugging the application I noticed os.makedirs is receiving the directory name with the trailing space, Python is trying to create it but the File System layer strips it (as explained here). So, I guess this can't be fixed (without an ugly Windows-only hack). For anyone else coming here with a similar error, the workaround is either creating it manually or using Linux.

Regards

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant