-
Notifications
You must be signed in to change notification settings - Fork 46
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
mdformat._util.atomic_write fails if dir isn't writeable #383
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Thanks, and sorry for taking so long to respond. #409 fixes this and a couple other issues. |
oh, thank you! <3 |
Describe the bug
context
I'm running mdformat on a directory of markdown docs in a perforce repo. In perforce, everything in a repo defaults to read-only, and only becomes writeable when checked out. Normally this should be fine, because I'm running mdformat on files I've checked out. However, the atomic_write function creates a temp dir in the current path, which in this case is not writeable unless I've explicitly checked it out.
expectation
I expect atomic_write to fall back to creating the temp dir in one of the default paths used by
tempfile.gettempdir()
as described at https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir or perhaps alternatively to give up on atomic writes and just do a best-effort?bug
atomic_write fails with a permission error :(
problem
This makes using mdformat with perforce slightly more difficult. It's not a blocker, just mildly annoying.
Reproduce the bug
List your environment
Python 3.9.1
The text was updated successfully, but these errors were encountered: