[issue41355] os.link(..., follow_symlinks=False) without linkat(3)

2020-07-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: Thanks for the analysis Eryk! I think you are right, changing the default to match the behavior that people have actually been experiencing on `os.link(src, dst)` makes sense. Possible suggestion: We can go one step further if anyone believes it is likel

[issue41355] os.link(..., follow_symlinks=False) without linkat(3)

2020-07-28 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue41355] os.link(..., follow_symlinks=False) without linkat(3)

2020-07-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > So, do you think it should just be documented that follow_symlinks is > effectively ignored with os.link() on most platforms that claim to support > it, unless either src_dir_fd or dst_dir_fd is used? At this stage, I am just trying to understand al

[issue41355] os.link(..., follow_symlinks=False) without linkat(3)

2020-07-28 Thread Ronald Oussoren
Ronald Oussoren added the comment: I agree that the current implementation is wonky. The implementation should use linkat(2) whenever it is available, that's the only portable way to honour the follow_symlinks flag as POSIX says that the behaviour for link(2) with symbolic links is impleme

[issue41355] os.link(..., follow_symlinks=False) without linkat(3)

2020-07-28 Thread Eryk Sun
Eryk Sun added the comment: > Isn't that a backwards-incompatible change? So, do you think it should just be documented that follow_symlinks is effectively ignored with os.link() on most platforms that claim to support it, unless either src_dir_fd or dst_dir_fd is used? I'd rather it was fix

[issue41355] os.link(..., follow_symlinks=False) without linkat(3)

2020-07-28 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > That said, since os.link() hasn't been working as advertised, this change > needs to be accompanied by changing the default value of follow_symlinks to > False. That will retain the status quo behavior for most systems, except in > the rare case tha

[issue41355] os.link(..., follow_symlinks=False) without linkat(3)

2020-07-27 Thread Eryk Sun
Eryk Sun added the comment: I'm trying to give os.link() and follow_symlinks the benefit of the doubt, but the implementation just seems buggy to me. POSIX says that "[i]f path1 names a symbolic link, it is implementation-defined whether link() follows the symbolic link, or creates a new li

[issue41355] os.link(..., follow_symlinks=False) without linkat(3)

2020-07-27 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch nosy: +pablogsal nosy_count: 1.0 -> 2.0 pull_requests: +20787 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/21648 ___ Python tracker

[issue41355] os.link(..., follow_symlinks=False) without linkat(3)

2020-07-21 Thread Ronald Oussoren
New submission from Ronald Oussoren : The code for os.link() seems to ignore follow_symlinks when the linkat(2) function is not available on the platform, which results in unexpected behaviour when "follow_symlinks" is false. -- components: Extension Modules messages: 374057 nosy: ron