Skip to content

Wrong follow_symlinks default fallback implementation #119885

Description

@yhx-12243

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')
wrong implementation of follow_symlinks

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

### Tasks

Linked PRs

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions