Skip to content

Commit

Permalink
Update quick-and-dirty implementation to match canonical implementati…
Browse files Browse the repository at this point in the history
…on. Closes #27
  • Loading branch information
jaraco committed Sep 21, 2024
1 parent 00bcfc0 commit d025474
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions jaraco/windows/bugs/vista-symlink-islink-bug.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
CreateSymbolicLink.argtypes = (LPWSTR, LPWSTR, DWORD)
CreateSymbolicLink.restype = BOOLEAN

# FIXME: link and target are inverted from jaraco.windows.filesystem
# https://github.com/jaraco/jaraco.windows/issues/27
def symlink(link, target, target_is_directory=False): # type: ignore[misc]
def symlink(target, link, target_is_directory=False):
"""
An implementation of os.symlink for Windows (Vista and greater)
"""
Expand All @@ -26,6 +24,6 @@ def symlink(link, target, target_is_directory=False): # type: ignore[misc]
os.makedirs(r'.\foo')
assert os.path.isdir(r'.\foo')

symlink(r'.\foo_sym', r'.\foo')
symlink(r'.\foo', r'.\foo_sym')
assert os.path.isdir(r'.\foo_sym')
assert os.path.islink(r'.\foo_sym') # fails

0 comments on commit d025474

Please sign in to comment.