Explicitly require Y/N for Command._ask
還沒有人認領這個 Issue。
評估
研究方向
從 src/manage/commands.py 的第 610-624 行附近開始,重點查看入口點 Command._ask 和相關的 prompt 邏輯。驗證諸如 yhn 這樣的輸入會被拒絕,而不是被當作 y 處理,同時預期的 Y/N 回應仍維持其預期行為。
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- Python
- 星號
- 344
- 分支
- 74
- 平均合併
- 1 天 3 小時
- 30 天內合併 PR
- 7
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python/pymanager 的其他 Issue
-
documentation
難度 1/5 1-3 小時 新手友好度 75/100
-
enhancement
難度 4/5 3-5 天 新手友好度 55/100
-
難度 4/5 3-5 天 新手友好度 45/100
-
enhancement
難度 4/5 3-5 天 新手友好度 45/100
-
難度 3/5 1-2 天 新手友好度 48/100
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
難度 1/5 1 小時以內 新手友好度 90/100
-
難度 2/5 1-3 小時 新手友好度 70/100
huggingface/Repo2RLEnv#163 · 1 則留言 ·
-
難度 1/5 1 小時以內 新手友好度 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
難度 2/5 1-3 小時 新手友好度 70/100
NousResearch/hermes-agent#121143 ·