-
-
Notifications
You must be signed in to change notification settings - Fork 656
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: Dont raise FileNotFoundError from close() on tmpfile rename #550
Conversation
check for file existence before fail-check Co-authored-by: Patrick Decat <pdecat@gmail.com>
Thx. Ad astra! |
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.
LGTM!
## [7.2.4](v7.2.3...v7.2.4) (2024-03-29) ### Bug Fixes * Dont raise FileNotFoundError from close() on tmpfile rename ([#550](#550)) ([58ba987](58ba987))
This PR is included in version 7.2.4 🎉 |
It looks like something wrong:
It will raise an exception!!! |
I'm going to add python lint checks to CI to catch this sort of mistakes. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
Allow
FileNotFoundError
to be ignored onclose()
to compensate for file already being renamedMotivation and Context
There appear to be some conditions by which the
self._tmp_filename
file has already been renamed/moved toself.filename
prior to (or racing with) the calling ofclose()
.In this case
FileNotFoundError
will be thrown, causing the Terraform to fail. But without changing anything, a subsequent run of the Terraform will succeed because the ZIP file already exists. (aka: it was created correctly on the first pass)Breaking Changes
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull request