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

Create parent directories if necessary #254

Merged
merged 5 commits into from Jul 24, 2023
Merged

Conversation

gerlero
Copy link
Contributor

@gerlero gerlero commented Jul 24, 2023

Closes #176

Implements @gaborbernat's #176 (comment); i.e., creates any necessary parent directories on acquire so that the open call doesn't cause a FileNotFoundError if those directories do not exist.

This could also be done using pathlib, but I chose to use os for consistency with the rest of the package. Also, I haven't tested if the change is actually needed on Windows too (I've made the same change to windows.py anyway).

@gerlero
Copy link
Contributor Author

gerlero commented Jul 24, 2023

This could also be done using pathlib, but I chose to use os for consistency with the rest of the package

Pre-commit CI failure seems to be exactly this; let me know how you want me to proceed.

@gaborbernat
Copy link
Member

Let's do pathlib 😊

@gerlero
Copy link
Contributor Author

gerlero commented Jul 24, 2023

Let's do pathlib 😊

Thanks, done!

Copy link
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaborbernat gaborbernat merged commit 492c401 into tox-dev:main Jul 24, 2023
36 checks passed
TheMatt2 pushed a commit to TheMatt2/py-filelock that referenced this pull request Jul 29, 2023
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@gaborbernat gaborbernat mentioned this pull request Aug 21, 2023
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.

FileNotFoundError: [Errno 2] No such file or directory: '/tmp/locks/my_lock.lock'
2 participants