Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Dec 13, 2021
Merged

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

merged 2 commits into from
Dec 13, 2021

Conversation

sp1thas
Copy link
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
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
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