Symlink containment check breaks on Python 3.8 runtimes

Open Beginner friendly
#119 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
tooling

Research direction

Start in sk/agents-md/skills/skill-scanner/scripts/scan_skill.py and inspect the symlink containment check using target.is_relative_to(). Reproduce the scan under Python 3.8 with a workspace containing a symlink case, then verify that supported legacy runtimes complete the scan without an AttributeError or aborting before results are produced.

Written by the indexing model from the issue text.

Description

Affected file: sk/agents-md/skills/skill-scanner/scripts/scan_skill.py

What I hit

I ran the scanner in a Python 3.8 setup and it crashed before producing scan results.

I’m thinking this is due to:

is_internal = target.is_relative_to(skill_dir.resolve())

which is not available on older interpreter versions.

Repro
  1. Execute the script under Python 3.8.
  2. Scan a workspace containing a symlink case.
  3. The script exits with AttributeError.
Expected

The scanner should run on legacy supported versions without crashing on path checks.

Actual

One API call can fail and abort the scan flow.

Suggested fix

Use .resolve() + relative_to with exception handling for Python compatibility.

Dominant language
Python
Stars
1k
Forks
52
Avg merge
7h 49m
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/skills

All issues in getsentry/skills

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.