Add an option to disable `realpath` when creating venv
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
These two lines of code sometimes make the executable path point somewhere unexpected:
https://github.com/python/cpython/blob/8b5ce31c2b44d9bf82e6119e90a52dd530bfd1db/Lib/venv/__init__.py#L210
https://github.com/python/cpython/blob/8b5ce31c2b44d9bf82e6119e90a52dd530bfd1db/Lib/venv/__init__.py#L240
Based on the following issue, realpath is necessary in some cases. However, there are situations where using "redirects, links or junctions" is intentional! For example, using subst to change drive letters or path for venv.
https://github.com/python/cpython/issues/89500
Would it be possible to add an option to disable the use of realpath during venv creation?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Lib/venv/init.py at the two linked realpath calls, then read issue 89500 to understand why realpath is needed in some cases. Determine where an opt-out belongs in venv creation and how the existing behavior should remain the default. Done means intentional redirects, links, or junctions can be preserved without breaking the cases covered by the existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100