Wrong `follow_symlinks` default fallback implementation
Open
Nobody has claimed this yet.
type-bug
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the fallback implementation in Modules/posixmodule.c around line 4274 and reproduce the os.link example on Linux to compare link and linkat behavior with follow_symlinks=True. Review linked PR gh-119886 for the work already underway; done means the fallback matches the documented follow_symlinks behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100