Skip to content

Fix FileNotFoundError when the download_dir is a non-existing nested folder#2910

Merged
tomaarsen merged 2 commits intonltk:developfrom
sp1thas:fix/nested-download-dir
Dec 13, 2021
Merged

Fix FileNotFoundError when the download_dir is a non-existing nested folder#2910
tomaarsen merged 2 commits intonltk:developfrom
sp1thas:fix/nested-download-dir

Conversation

@sp1thas
Copy link
Copy Markdown
Contributor

@sp1thas sp1thas commented Dec 12, 2021

The purpose of this PR is to resolve #2904 by replacing the os.mkdir with os.makedirs in order to prevent FileNotFoundError when the download_dir is a non-existing nested directory (parent direcotry does not exists)

…when trying to use non-existing nested folders
@iliakur
Copy link
Copy Markdown
Contributor

iliakur commented Dec 13, 2021

I wonder how easy it would be to add tests for this... pytest has some fixtures to create temporary directories.

@tomaarsen tomaarsen merged commit dea7b44 into nltk:develop Dec 13, 2021
@tomaarsen
Copy link
Copy Markdown
Member

Perfect! Thanks a bunch @sp1thas. Great tests, too.

@sp1thas sp1thas deleted the fix/nested-download-dir branch February 12, 2022 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Downloader fails when download_dir is a nested folder that doesn't exist

3 participants