Add ability to filter out results of `shutil.which` by `os.stat_result.st_flags`
未關閉
還沒有人認領這個 Issue。
stdlib
type-feature
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 36k
- 平均合併
- 1 天 9 小時
- 30 天內合併 PR
- 558
描述
Feature or enhancement
Add ability to filter out results of https://docs.python.org/3/library/shutil.html#shutil.which by https://docs.python.org/3/library/os.html#os.stat_result.st_flags
Pitch
- https://en.wikipedia.org/wiki/System_Integrity_Protection
- https://github.com/pypa/hatch/issues/701#issuecomment-1374595003
Basically, it is desirable to call/use a version of an installed executable that is not restricted by macOS SIP such as when modifying linker environment variables.
Previous discussion
Somewhat related https://github.com/python/cpython/issues/76528
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 shutil.which 和 os.stat_result.st_flags 的文件開始,並檢視連結的 macOS SIP 與先前討論中的 issue。確定預期的篩選介面和平台特定行為,然後驗證可執行檔選取會排除所要求的 st_flags 情況,同時不變更其他平台。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- operating-systems
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100