Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faked os.link is missing the follow_symlinks parameter #973

Closed
vector-of-bool opened this issue Mar 11, 2024 · 1 comment · Fixed by #975
Closed

Faked os.link is missing the follow_symlinks parameter #973

vector-of-bool opened this issue Mar 11, 2024 · 1 comment · Fixed by #975
Labels

Comments

@vector-of-bool
Copy link

Describe the bug
Pretty much what it says on the tin.

How To Reproduce

def link_nofollow(s: Path, d: Path):
    s.unlink(missing_ok=True)
    d.unlink(missing_ok=True)
    s.symlink_to("nowhere")
    os.link(s, d, follow_symlinks=False)
    assert os.readlink(d) == "nowhere"

def test_realfs():
    link_nofollow(Path("file.txt"), Path("another.txt"))

def test_fakefs(fs):
    link_nofollow(Path("file.txt"), Path("another.txt"))

Your environment
Please run the following in the environment where the problem happened and
paste the output.

$ python -c "import platform; print(platform.platform())"
Linux-6.7.6-arch1-1-x86_64-with-glibc2.39
$ python -c "import sys; print('Python', sys.version)"
Python 3.11.7 (main, Jan 29 2024, 16:03:57) [GCC 13.2.1 20230801]
$ python -c "from pyfakefs import __version__; print('pyfakefs', __version__)"
pyfakefs 5.4.dev0
$ python -c "import pytest; print('pytest', pytest.__version__)"
pytest 7.2.0
@mrbean-bremen
Copy link
Member

This was actually implemented in fake_filesystem, but not added fake_os.
As usual: please check!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants