Skip to content

Library frames read the same through a symlinked Python - #128

Merged
antonrh merged 1 commit into
mainfrom
library-paths-symlinks
Oct 26, 2026
Merged

antonrh merged 1 commit into
mainfrom
library-paths-symlinks

Conversation

@antonrh

@antonrh antonrh commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

With uv's managed Python (cpython-3.14-… a symlink to cpython-3.14.0-…), stdlib frames in profiles, errors and called-from showed the full install path, home directory included: the library roots were resolved, co_filename was not.

  • Library roots are kept both as given and resolved; a file matching neither is resolved once (cached per file).
  • relative() resolves file and root when they don't match as named (/tmp vs /private/tmp on macOS).

Checked: new tests for both directions (fail on main), full suite, poe lint, and a 3.14 interpreter run through the symlinked uv dir names threading.py.

uv installs Python in a directory a symlink names by its minor version.
The library roots were resolved, a code object's file was not: profile,
error and called-from frames showed the full install path. Both spellings
of each root now match, a file that matches neither is resolved once
(cached), and a project file is named relative to a symlinked root too.
@codspeed

codspeed Bot commented Oct 26, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 19 untouched benchmarks


Comparing library-paths-symlinks (fb57399) with main (f7ce243)

Open in CodSpeed

@antonrh
antonrh merged commit a08096e into main Oct 26, 2026
17 of 18 checks passed
@antonrh antonrh mentioned this pull request Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant