Skip to content

Commit

Permalink
Fix incorrect handling of dirfd in os.symlink
Browse files Browse the repository at this point in the history
- changed tests to also run in real OS
- work in progress
  • Loading branch information
mrbean-bremen committed Mar 10, 2024
1 parent ebbaa73 commit 12b20ae
Show file tree
Hide file tree
Showing 2 changed files with 231 additions and 182 deletions.
6 changes: 3 additions & 3 deletions pyfakefs/fake_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,12 +1162,12 @@ def symlink(
dst: Path to the symlink to create.
target_is_directory: Currently ignored.
dir_fd: If not `None`, the file descriptor of a directory,
with `src` being relative to this directory.
with `dst` being relative to this directory.
Raises:
OSError: if the file already exists.
"""
src = self._path_with_dir_fd(src, self.symlink, dir_fd)
dst = self._path_with_dir_fd(dst, self.symlink, dir_fd)
self.filesystem.create_symlink(dst, src, create_missing_dirs=False)

def link(
Expand All @@ -1178,7 +1178,7 @@ def link(
src_dir_fd: Optional[int] = None,
dst_dir_fd: Optional[int] = None,
) -> None:
"""Create a hard link at new_path, pointing at old_path.
"""Create a hard link at dst, pointing at src.
Args:
src: An existing path to the target file.
Expand Down
Loading

0 comments on commit 12b20ae

Please sign in to comment.