Wrong `follow_symlinks` default fallback implementation
未關閉
還沒有人認領這個 Issue。
type-bug
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 36k
- PR 合併指標
- PR 指標待擷取
描述
Bug report
Bug description:
By https://github.com/python/cpython/blob/96b392d/Modules/posixmodule.c#L4274, if follow_symlinks = True, Python will choose to call syscall link rather than linkat. However, the behavior of link will have AT_SYMLINK_FOLLOW unset, which leads an opposite behavior.
import os
os.link('link', 'another-file')
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
### Tasks
Linked PRs
- gh-119886
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 Modules/posixmodule.c 中約第 4274 行的回退實作開始,並在 Linux 上重現 os.link 範例,以比較 link 和 linkat 在 follow_symlinks=True 時的行為。查看已連結的 PR gh-119886,了解已在進行的工作;當回退實作符合文件所述的 follow_symlinks 行為時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- c, python
- 領域
- operating-systems
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 描述清楚
- 新手友好度
- 25/100