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

Gregory P. Smith report at bugs.python.org
Wed Jul 29 17:14:59 EDT 2020


Gregory P. Smith <greg at krypto.org> 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 likely to be necessary: Preserve the exiting buggy behavior regardless of src_dir_fd= value when follow_symlinks is not explicitly provided as an argument.  This way the behavior for people who did not specify it remains unchanged <= 3.9.  This would be the principal of no surprise.  (it'd effectively become a tri-state _UNSPECIFIED/True/False value where _UNSPECIFIED depends on the mess of conditionals described by Eryk)

Documentation up through 3.9 should be updated to note the oddity.

In 3.8 & 3.9 if it _is_ explicitly specified, fixing the bug so that it actually honors that makes sense.

In 3.10 we should honor the new =False default without this tri-state behavior bug-compatible-by-default at all.

This is more complicated to implement.  I'd also be happy with the already described "just updating the default to False and fixing forward in 3.10 to actually honor True properly."

META: Regarding macOS, can we update the macOS version used to build the installers for 3.10?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41355>
_______________________________________


More information about the Python-bugs-list mailing list