Skip to content

Commit

Permalink
Fix missed Windows changes
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Nov 1, 2024
1 parent 00abf8a commit 3db0e18
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Lib/pathlib/_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,16 @@ def copy_file(self, source, target, metadata_keys, dir_entry=None):
if os.name == 'nt':
def copy_symlink(self, source, target, metadata_keys, dir_entry=None):
"""Copy the given symlink to the given target."""
metadata = source._read_metadata(
metadata_keys, follow_symlinks=False, dir_entry=dir_entry)
target.symlink_to(source.readlink(), (dir_entry or source).is_dir())
target._write_metadata(metadata, follow_symlinks=False)
if metadata_keys:
metadata = source._read_metadata(
metadata_keys, follow_symlinks=False, dir_entry=dir_entry)
else:
metadata = None
symlink_target = source.readlink()
symlink_is_directory = (dir_entry or source).is_dir()
target.symlink_to(symlink_target, symlink_is_directory)
if metadata:
target._write_metadata(metadata, follow_symlinks=False)


class PurePath(PurePathBase):
Expand Down

0 comments on commit 3db0e18

Please sign in to comment.