Documentation of sys.base_prefix is unclear when a virtual environment is created from another virtual environment
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- documentation
Research direction
Start with the sys.base_prefix and sys.base_exec_prefix documentation, then inspect the behavior described for nested venv creation using the shown commands. Read site.py and check the effect of Python's -S flag. Done means the documentation explicitly states the expected values for nested virtual environments and documents the -S behavior.
Written by the indexing model from the issue text.
Description
Documentation of the sys module
The documentation of sys.base_prefix states that "base_prefix and base_exec_prefix will remain pointing to the base Python installation (the one which the virtual environment was created from)"
In the case of creating one virtual environment from another:
python -m venv foo --without pip
foo/Scripts/python.exe -m venv bar --without-pip
sys.base_prefix in bar points to the system Python installation, not to foo. (Tested on Windows). I believe this behaviour is better, and I'm suspect that existing tools rely on it, but regardless of what is correct behaviour, the documentation should be more explicit about what the expected value of sys.base_prefix is in a virtual environment created from another virtual environment.
Also, given that the behaviour is documented as being (at least in part) implemented in site.py, the behaviour when the -S flag ("don't import site") is supplied to Python should be documented as well.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 558
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.
More from python/cpython
-
docs pending
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
stdlib type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
stdlib type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
build type-bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
stdlib topic-email type-feature
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
🐛 Bug 🔔 Pending processing
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
jumpserver/jumpserver#17584 ·