fix(helper): avoid unhandled EOFError in build_image when running non-interactively - #15971
Open
alifakbxr wants to merge 1 commit into
Open
fix(helper): avoid unhandled EOFError in build_image when running non-interactively#15971alifakbxr wants to merge 1 commit into
alifakbxr wants to merge 1 commit into
Conversation
…-interactively without pull arguments
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.
Fixes #15970
Issue:
When executing
python3 infra/helper.py build_image <project>without specifying either the--pullor--no-pullarguments, the script prompts the user for a pull decision usingraw_input. If this command is run in a non-interactive environment (e.g. CI/CD or with standard input closed/redirected to/dev/null),raw_inputthrows an unhandledEOFError, exposing a confusing Python traceback and causing the automation to fail unpredictably.Fix:
This PR catches the
EOFErrorexception raised byraw_inputduring the prompt. Instead of emitting a traceback, it cleanly catches the exception, logs a concise error message (No input available. Please specify --pull or --no-pull when running non-interactively.), and safely exits the image build process with a failed status. This gives automated callers a stable CLI diagnostic and clearly communicates how to resolve the issue.