Skip to content

Commit

Permalink
Implement is_symlink.
Browse files Browse the repository at this point in the history
Closes #117
  • Loading branch information
jaraco committed May 26, 2024
1 parent 387dcea commit dc5fe8f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions newsfragments/117.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implement is_symlink.
1 change: 0 additions & 1 deletion tests/test_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,6 @@ def test_eq_hash(self, alpharep):
root = zipfile.Path(alpharep)
assert root in {root}

@__import__('pytest').mark.xfail(reason="Not implemented")
@pass_alpharep
def test_is_symlink(self, alpharep):
root = zipfile.Path(alpharep)
Expand Down
7 changes: 5 additions & 2 deletions zipp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import contextlib
import pathlib
import re
import stat
import sys

from .compat.py310 import text_encoding
Expand Down Expand Up @@ -391,9 +392,11 @@ def match(self, path_pattern):

def is_symlink(self):
"""
Return whether this path is a symlink. Always false (python/cpython#82102).
Return whether this path is a symlink.
"""
return False
info = self.root.getinfo(self.at)
mode = info.external_attr >> 16
return stat.S_ISLNK(mode)

def glob(self, pattern):
if not pattern:
Expand Down

0 comments on commit dc5fe8f

Please sign in to comment.