FujiwaraChoki/MoneyPrinterV2 · warning · ValueError

Empty input is not allowed.

Error message

Empty input is not allowed.

What it means

ValueError raised by the main menu loop when input() returns an empty (whitespace-stripped) string. It is immediately caught by the surrounding `except ValueError`, printing 'Invalid input: Empty input is not allowed.', clearing the screen, and re-prompting — a control-flow error, not a crash.

Source

Thrown at src/main.py:59

    Returns:
        None"""

    # Get user input
    # user_input = int(question("Select an option: "))
    valid_input = False
    while not valid_input:
        try:
    # Show user options
            info("\n============ OPTIONS ============", False)

            for idx, option in enumerate(OPTIONS):
                print(colored(f" {idx + 1}. {option}", "cyan"))

            info("=================================\n", False)
            user_input = input("Select an option: ").strip()
            if user_input == '':
                print("\n" * 100)
                raise ValueError("Empty input is not allowed.")
            user_input = int(user_input)
            valid_input = True
        except ValueError as e:
            print("\n" * 100)
            print(f"Invalid input: {e}")


    # Start the selected option
    if user_input == 1:
        info("Starting YT Shorts Automater...")

        cached_accounts = get_accounts("youtube")

        if len(cached_accounts) == 0:
            warning("No accounts found in cache. Create one now?")
            user_input = question("Yes/No: ")

            if user_input.lower() == "yes":

View on GitHub (pinned to 5192af8eca)

Solutions

  1. Simply re-enter a valid numeric option at the prompt
  2. If scripting, feed a valid choice via stdin: `echo 1 | python3 src/main.py`
  3. Add a default option or reprompt without stack noise if desired
Defensive patterns

Strategy: validation

Validate before calling

user_input = input("Select an option: ").strip()
if not user_input.isdigit():
    print("Please enter a number"); continue

Prevention

When it happens

Trigger: Running src/main.py and pressing ENTER at the 'Select an option:' prompt without typing a number; also triggered by any non-numeric input via int(user_input) raising ValueError.

Common situations: User hitting ENTER accidentally, piping empty lines into the CLI, or automated invocation of main.py without stdin input.

Related errors


AI-assisted analysis of FujiwaraChoki/MoneyPrinterV2@5192af8eca (2026-08-28). Data as JSON: /api/errors/eff5b7f47c8e5f9b. Report an issue: GitHub.