-
-
Notifications
You must be signed in to change notification settings - Fork 375
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: use os.replace instead of shutil.move for renaming file #2223
fix: use os.replace instead of shutil.move for renaming file #2223
Conversation
The current usage of Also, a point to note is that, if the destination file exists |
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/2223 |
Can you point me where it says this is atomic on Windows? The docs don't seem to mention that |
@JacobCoffee - this is a good issue for a ruff rule. I see there is a new noqa added by this pr, so it should be brought to their attention I'd say |
I don't think this would make a good rule really? Ruff can't know if you need the atomicity, and aside from that there are differences in behaviour of the functions that might otherwise be relevant. |
as an aside, I would be interested in enabling all ruff rules rather than the 75 line list we have now. Reason being is that as new ruff rules are added, we wouldn't know.. if we enabled them all and selectively disabled then we would get the newest new there is, and possibly greatly shorten our pyproject.toml |
why not do it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understood what I read, internally
Just posting this here for documentation purposes. |
I wasn't able to find direct documentation that states that
Also, this issue is the one that changes from using |
Pull Request Checklist
Description
os.replace
instead ofshutil.move
for renaming files to ensure atomicity.Close Issue(s)