Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Explicitly require Y/N for Command._ask

未關閉
#244 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
55/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
python
領域
cli

研究方向

從 src/manage/commands.py 的第 610-624 行附近開始,重點查看入口點 Command._ask 和相關的 prompt 邏輯。驗證諸如 yhn 這樣的輸入會被拒絕,而不是被當作 y 處理,同時預期的 Y/N 回應仍維持其預期行為。

由索引模型根據 Issue 內容生成。

描述

enhancement

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

https://github.com/python/pymanager/blob/682d0f87a0eadb3e137b065cda0b3a74d8e83fa2/src/manage/commands.py#L610-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

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

python/pymanager 的其他 Issue

查看 python/pymanager 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。