Skip to content

Title: Application panics on stdin/stdout operations in non-interactive environments #45

@Adithyakp86

Description

@Adithyakp86

Description: The functions ask_if_create_venv in src/utils.rs uses unwrap() on io::stdout().flush() and io::stdin().read_line(). If the application is run in a non-interactive environment (like a CI/CD pipeline or a background cron job) where stdin is closed or redirected, these calls will panic, causing the application to crash unexpectedly.

Solution: Replace unwrap() with proper error handling. If read_line fails (indicating no stdin), assume a default answer (e.g., "no" or "yes" depending on safety) or return a specific error that can be handled gracefully. Alternatively, check if a TTY is attached using atty crate before attempting to read input.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions