Explicitly require Y/N for Command._ask
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 344
- フォーク
- 74
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 7
説明
Is your feature request related to a problem? Please describe.
Had pymanager uninstall <tag> in my terminal and in a dumb panic on my split keyboard, submitted the characters yhn:
pymanager uninstall 3.13.11
Uninstall Python 3.13.11? [Y/n] yhn
Expected to cancel/break since yhn does not match a provided option - y or n.
In actuality, it proceeded to remove that python installation.
Describe the solution you'd like
Literally match for the submitted character y or n.
Describe alternatives you've considered
Not panicking and hitting n (or hitting anything else really, as long as it does not start with y)
Additional context
Was a silly mistake that costed me enough rebuild time that I came back just to figure out why it happened.
https://github.com/python/pymanager/blob/main/src/manage/commands.py#L624
Since we match via startswith, it does not matter what the remaining characters are - as long as expect_char is the first char, then _ask evaluates.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
src/manage/commands.py の 610〜624 行付近、特にエントリポイントの Command._ask と関連する prompt ロジックから始めます。yhn のような入力が y として扱われず拒否されることを確認し、意図された Y/N の応答では期待される動作が維持されることを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- cli
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 55/100