fix(addDummyToLef): prevent fd leaks and add input file validation with clear error handling#4067
Merged
eder-matheus merged 1 commit intoMar 30, 2026
Conversation
Contributor
Author
|
Hi @maliberty @eder-matheus, |
maliberty
approved these changes
Mar 28, 2026
Replace bare open()/close() pairs with with-statements and add an input file existence check with a clear error message. Signed-off-by: Ashnaa Seth <ashnaaseth2325@gmail.com> Signed-off-by: ashnaaseth2325-oss <ashnaaseth2325@gmail.com>
auto-merge was automatically disabled
March 28, 2026 19:34
Head branch was pushed to by a user without write access
a2c16cd to
fa84634
Compare
Contributor
Author
|
Hello @maliberty |
Contributor
Author
|
Hello @maliberty |
33d1978
into
The-OpenROAD-Project:master
8 of 9 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. SUMMARY
This PR fixes unsafe file handling in
flow/util/addDummyToLef.pyby replacing manualopen()/close()usage with context managers and adding an input file existence check. It ensures proper resource cleanup and provides clear error messages when the input LEF file is missing.2. FIX
3. VERIFICATION
Run the script with an invalid
--inputLefpath and confirm it exits cleanly with a clear error message instead of a traceback. Then run it with a valid LEF file and verify the output is generated correctly with no behavior changes. Also confirm no file descriptor issues occur during read/write failures.