Skip to content

Fix EOFError and escaped newlines in InstaReporter#37

Open
sipan-zaxo wants to merge 1 commit into
muneebwanee:mainfrom
sipan-zaxo:sipan-zaxo-run-app
Open

Fix EOFError and escaped newlines in InstaReporter#37
sipan-zaxo wants to merge 1 commit into
muneebwanee:mainfrom
sipan-zaxo:sipan-zaxo-run-app

Conversation

@sipan-zaxo

Copy link
Copy Markdown

Problem

The script had two runtime issues:

  1. EOFError when running in non-interactive environments - the ask_question() function didn't handle missing stdin gracefully
  2. Escaped newlines displayed literally as \n instead of actual newlines in console output

Solution

  • Added try/except error handling in ask_question() to catch EOF errors and gracefully exit with a clear error message
  • Fixed all escaped newline sequences (\\n) to proper Python newlines (\n) in print statements (lines 96, 106, and 116)

Testing

Verified the script now:

  • Starts without crashing on import/initialization
  • Displays the logo and status messages correctly with proper formatting
  • Handles missing input gracefully without stack traces

- Add try/except in ask_question() to gracefully handle EOF errors when stdin is unavailable
- Fix escaped newline sequences (\\n) to proper newlines (\n) in print statements
- Improves script robustness when running in non-interactive environments

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant