Skip to content

Preserver Symlinks in pyvenv.cfg paths - #3022

Merged
gaborbernat merged 3 commits into
pypa:mainfrom
rahuldevikar:users/rahuldevikar/fix2770
Feb 2, 2026
Merged

Preserver Symlinks in pyvenv.cfg paths#3022
gaborbernat merged 3 commits into
pypa:mainfrom
rahuldevikar:users/rahuldevikar/fix2770

Conversation

@rahuldevikar

@rahuldevikar rahuldevikar commented Feb 1, 2026

Copy link
Copy Markdown
Contributor

Use os.path.abspath() instead of os.path.realpath() when writing pyvenv.cfg
to match venv behavior. This preserves symlinks in paths, fixing issues with
Python installations accessed via symlinked directories (common in network-
mounted filesystems and scientific computing environments).

Fixes: #2770

Thanks for contributing, make sure you address all the checklists (for details on how see development documentation)

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

@gaborbernat
gaborbernat merged commit 9909c18 into pypa:main Feb 2, 2026
51 checks passed
This was referenced Mar 12, 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.

Created virtual env does not honour sys.base_prefix correctly

2 participants