summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2024-06-03 15:13:07 (GMT)
committerGitHub <noreply@github.com>2024-06-03 15:13:07 (GMT)
commit42a34ddb0b63e638905b01e17a7254623a0de427 (patch)
tree91a5a67346c3d852f8587a8a7369d7448f7ec5bb /Lib/zipfile
parentfd01271366abefa8f991e53f090387882fbd6bdd (diff)
downloadcpython-42a34ddb0b63e638905b01e17a7254623a0de427.zip
cpython-42a34ddb0b63e638905b01e17a7254623a0de427.tar.gz
cpython-42a34ddb0b63e638905b01e17a7254623a0de427.tar.bz2
gh-119588: Implement zipfile.Path.is_symlink (zipp 3.19.0). (#119591)
Diffstat (limited to 'Lib/zipfile')
-rw-r--r--Lib/zipfile/_path/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/zipfile/_path/__init__.py b/Lib/zipfile/_path/__init__.py
index 79ebb77..f5ea18c 100644
--- a/Lib/zipfile/_path/__init__.py
+++ b/Lib/zipfile/_path/__init__.py
@@ -5,6 +5,7 @@ import itertools
import contextlib
import pathlib
import re
+import stat
import sys
from .glob import Translator
@@ -390,9 +391,11 @@ class Path:
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: