Skip to content

Fix error: module 'os' has no attribute 'mkdirs'#60

Merged
daknob merged 2 commits intodaknob:masterfrom
c-w:bugfix/mkdirs
Oct 16, 2017
Merged

Fix error: module 'os' has no attribute 'mkdirs'#60
daknob merged 2 commits intodaknob:masterfrom
c-w:bugfix/mkdirs

Conversation

@c-w
Copy link
Copy Markdown
Contributor

@c-w c-w commented Oct 16, 2017

Without this fix, the initialize_backend method fails with the error being silently swallowed by the broad except block.

In order to avoid these sorts of exception masking issues going forward, commit ff68452 also removes the except blocks that wrap the os.makedirs calls in favor of the exist_ok flag so that the only exceptions that get ignored are ones related to the directory already existing. The exist_ok argument was added in Python 3.2 (source). Given that this project supports Python 3.5+, it should be fine to use this flag.

@daknob daknob merged commit 60d6e12 into daknob:master Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants