Skip to content

fix(cli): re-prompt on invalid confirmation answers instead of cancelling - #1244

Open
kaggle-marvin wants to merge 1 commit into
mainfrom
marvin/confirmation-reprompt
Open

kaggle-marvin wants to merge 1 commit into
mainfrom
marvin/confirmation-reprompt

Conversation

@kaggle-marvin

Copy link
Copy Markdown
Collaborator

`KaggleApi.confirmation()` (used by `kaggle b init`/`b auth` and the delete commands) cancelled on the first answer it didn't recognise, even though it's wrapped in a `while True` loop. It also didn't strip input, so `y ` or a stray `\r` counted as invalid, and the error text ("Please respond with 'yes' or 'no'") made the `[Y/n]` prompt look like it required typing `yes`.

Changes:

  • Strip input before matching.
  • Ask again on an invalid answer instead of returning `False`.
  • Return `False` on closed stdin (EOF) so piped or non-interactive runs can't loop forever.
  • Error text now says `'y' or 'n'`.

Tests: new `tests/unit/test_confirmation.py`. The existing delete and benchmarks unit tests still pass.

Reported in https://chat.kaggle.net (thread fttawmbz8byp8gdgh6jkwr8ymc).

@iryna-shakhova iryna-shakhova self-assigned this Nov 12, 2026
@sridipbasu sridipbasu added the bug Something isn't working label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants