Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
bpo-37612: always call linkat() from os.link(), if available#14843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation
The issue with link() is that POSIX does not define its behaviorregarding symbolic links:"If path1 names a symbolic link, it is implementation-defined whetherlink() follows the symbolic link, or creates a new link to the symboliclink itself."And it is indeed implemented differently on Linux and NetBSD.
gnprice commentedAug 1, 2019
As I understand it from your bpo report, the issue is that the behavior of In particular the actual behavior on such platforms makes That sounds like a good fix to me! Would you add a test for it? See test_os.py, or perhaps test_posix.py if the test doesn't make sense to run on Windows. |
takluyver commentedMar 23, 2021
I've had a go at adding the test in#24997. |
The following commit authors need to sign the Contributor License Agreement: |
serhiy-storchaka commentedMay 4, 2025
Fixed by#132517. |
Uh oh!
There was an error while loading.Please reload this page.
The issue with link() is, that POSIX does not define its behavior regarding symbolic links:
"If path1 names a symbolic link, it is implementation-defined whether link() follows the symbolic link, or creates a new link to the symbolic link itself."
And it is indeed implemented differently on e.g. Linux and NetBSD. So, it makes no sense to call link(), where linkat() is available.
https://bugs.python.org/issue37612