Menu

#275 test: extend ASCII-only guarantee to 2fa remove and setup mode errors (#254)

closed
nobody
None
2026-08-18
2026-08-06
Anonymous
No

Originally created by: Wsif123

Rebased on current main and ready for review.

Fixes issue [#254]: two user-facing CLI messages slipped non-ASCII dashes past the cp1252-safe onboarding guarantee.

  • \src/doberman/cli/main.py\: the \2fa remove\ warning used an em-dash (U+2014) - still live on main, replaced with a plain hyphen
  • The \parse_mode_choice\ en-dash was already fixed by [#266]; this PR's \ est_setup_bad_mode_choice_error_is_ascii_and_cp1252_safe\ now guards that message against regression (the wizard re-prompts since [#266], so the test feeds a valid choice after the invalid one)

Tests added (run in CI)

Extended \ ests/unit/test_cli_encode_safe.py\ so the ASCII guarantee covers the two paths that slipped through:

  • \ est_2fa_remove_warning_is_ascii_and_cp1252_safe\ - drives \2fa remove\ to the no-possession-factor warning and asserts ASCII + cp1252 safety
  • \ est_setup_bad_mode_choice_error_is_ascii_and_cp1252_safe\ - drives a bad numeric mode choice through the wizard and asserts the re-prompt message is ASCII + cp1252-safe

Verified both new tests go RED when the character fixes are reverted. \
uff check\, \
uff format --check\ and the touched unit tests pass on Python 3.11 and 3.13.

Related

Tickets: #254
Tickets: #266

Discussion

  • Anonymous

    Anonymous - 2026-08-06

    Originally posted by: Wsif123

    Dropping out - closing this PR and removing my changes. Apologies for the noise.

     
  • Anonymous

    Anonymous - 2026-08-06

    Ticket changed by: Wsif123

    • status: open --> closed
     
  • Anonymous

    Anonymous - 2026-08-18

    Originally posted by: fu351

    @Wsif123 Even though this PR didn't land, the ASCII-guarantee instinct was right; that same class of bug later got a cp1252 fix in the auth prompt. I hope you take another swing.

    Quick community roll-call: are you in the Doberman Discord? If yes, drop your handle here (or DM me there) so I can match the GitHub side of your work to your Discord name. If not, you're warmly invited: https://discord.gg/Sfy5XGNqty

     

Log in to post a comment.