◐ Shell
reader mode source ↗
Skip to content

gh-81793: always call linkat() from os.link(), if available#24997

Closed
takluyver wants to merge 4 commits into
python:mainfrom
takluyver:bpo-37612
Closed

gh-81793: always call linkat() from os.link(), if available#24997
takluyver wants to merge 4 commits into
python:mainfrom
takluyver:bpo-37612

Conversation

@takluyver

@takluyver takluyver commented Mar 23, 2021

Copy link
Copy Markdown
Contributor

This is a continuation of PR GH-14843 (closes GH-14843), adding a test. I've pasted the original description below.

I had to rework the change a bit; I find the Apple specific stuff confusing, so I hope I've got it right. 😕


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

https://bugs.python.org/issue37612

takluyver and others added 3 commits March 23, 2021 17:33
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 Linux and NetBSD.
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 23, 2021
@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Aug 6, 2022
@picnixz picnixz changed the title bpo-37612: always call linkat() from os.link(), if available Apr 12, 2025
@python-cla-bot

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

CLA signed

@serhiy-storchaka

Copy link
Copy Markdown
Member

Fixed by #132517.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants