Skip to content

Commit

Permalink
Revert "Test also the hidden flag for symlink target."
Browse files Browse the repository at this point in the history
This reverts commit 59ee5f3.
  • Loading branch information
serhiy-storchaka committed Jan 5, 2024
1 parent 0cb3519 commit 1cef7cd
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions Lib/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,22 +177,14 @@ def addpackage(sitedir, name, known_paths):
(getattr(st, 'st_file_attributes', 0) & stat.FILE_ATTRIBUTE_HIDDEN)):
_trace(f"Skipping hidden .pth file: {fullname!r}")
return
_trace(f"Processing .pth file: {fullname!r}")
try:
# locale encoding is not ideal especially on Windows. But we have used
# it for a long time. setuptools uses the locale encoding too.
f = io.TextIOWrapper(io.open_code(fullname), encoding="locale")
except OSError:
return
with f:
if stat.S_ISLNK(st.st_mode) and hasattr(st, 'st_flags'):
try:
st = os.fstat(f.fileno())
except OSError:
return
if st.st_flags & stat.UF_HIDDEN:
_trace(f"Skipping hidden .pth file: {fullname!r}")
return
_trace(f"Processing .pth file: {fullname!r}")
for n, line in enumerate(f):
if line.startswith("#"):
continue
Expand Down

0 comments on commit 1cef7cd

Please sign in to comment.