@@ -130,27 +130,26 @@ always available.
130
130
131
131
.. data :: base_exec_prefix
132
132
133
- Set during Python startup, before ``site.py `` is run, to the same value as
134
- :data: `exec_prefix `. If not running in a
135
- :ref: `virtual environment <venv-def >`, the values will stay the same; if
136
- ``site.py `` finds that a virtual environment is in use, the values of
137
- :data: `prefix ` and :data: `exec_prefix ` will be changed to point to the
138
- virtual environment, whereas :data: `base_prefix ` and
139
- :data: `base_exec_prefix ` will remain pointing to the base Python
140
- installation (the one which the virtual environment was created from).
133
+ Equivalent to :data: `exec_prefix `, but refering to the base Python installation.
134
+
135
+ When running under :ref: `sys-path-init-virtual-environments `,
136
+ :data: `exec_prefix ` gets overwritten to the virtual environment prefix.
137
+ :data: `base_exec_prefix `, conversely, does not change, and always points to
138
+ the base Python installation.
139
+ Refer to :ref: `sys-path-init-virtual-environments ` for more information.
141
140
142
141
.. versionadded :: 3.3
143
142
144
143
145
144
.. data :: base_prefix
146
145
147
- Set during Python startup, before `` site.py `` is run, to the same value as
148
- :data: ` prefix `. If not running in a :ref: ` virtual environment < venv-def >`, the values
149
- will stay the same; if `` site.py `` finds that a virtual environment is in
150
- use, the values of :data: `prefix ` and :data: ` exec_prefix ` will be changed to
151
- point to the virtual environment, whereas :data: `base_prefix ` and
152
- :data: ` base_exec_prefix ` will remain pointing to the base Python
153
- installation (the one which the virtual environment was created from) .
146
+ Equivalent to :data: ` prefix `, but refering to the base Python installation.
147
+
148
+ When running under :ref: ` virtual environment < venv-def >`,
149
+ :data: `prefix ` gets overwritten to the virtual environment prefix.
150
+ :data: `base_prefix `, conversely, does not change, and always points to
151
+ the base Python installation.
152
+ Refer to :ref: ` sys-path-init- virtual-environments ` for more information .
154
153
155
154
.. versionadded :: 3.3
156
155
@@ -483,11 +482,19 @@ always available.
483
482
484
483
.. note ::
485
484
486
- If a :ref: `virtual environment <venv-def >` is in effect, this
487
- value will be changed in `` site.py `` to point to the virtual environment.
488
- The value for the Python installation will still be available, via
489
- :data: ` base_exec_prefix ` .
485
+ If a :ref: `virtual environment <venv-def >` is in effect, this :data: ` exec_prefix `
486
+ will point to the virtual environment. The value for the Python installation
487
+ will still be available, via :data: ` base_exec_prefix `.
488
+ Refer to :ref: ` sys-path-init-virtual-environments ` for more information .
490
489
490
+ .. versionchanged :: 3.14
491
+
492
+ When running under a :ref: `virtual environment <venv-def >`,
493
+ :data: `prefix ` and :data: `exec_prefix ` are now set to the virtual
494
+ environment prefix by the :ref: `path initialization <sys-path-init >`,
495
+ instead of :mod: `site `. This means that :data: `prefix ` and
496
+ :data: `exec_prefix ` always point to the virtual environment, even when
497
+ :mod: `site ` is disabled (:option: `-S `).
491
498
492
499
.. data :: executable
493
500
@@ -1483,10 +1490,21 @@ always available.
1483
1490
argument to the :program: `configure ` script. See
1484
1491
:ref: `installation_paths ` for derived paths.
1485
1492
1486
- .. note :: If a :ref:`virtual environment <venv-def>` is in effect, this
1487
- value will be changed in ``site.py `` to point to the virtual
1488
- environment. The value for the Python installation will still be
1489
- available, via :data: `base_prefix `.
1493
+ .. note ::
1494
+
1495
+ If a :ref: `virtual environment <venv-def >` is in effect, this :data: `prefix `
1496
+ will point to the virtual environment. The value for the Python installation
1497
+ will still be available, via :data: `base_prefix `.
1498
+ Refer to :ref: `sys-path-init-virtual-environments ` for more information.
1499
+
1500
+ .. versionchanged :: 3.14
1501
+
1502
+ When running under a :ref: `virtual environment <venv-def >`,
1503
+ :data: `prefix ` and :data: `exec_prefix ` are now set to the virtual
1504
+ environment prefix by the :ref: `path initialization <sys-path-init >`,
1505
+ instead of :mod: `site `. This means that :data: `prefix ` and
1506
+ :data: `exec_prefix ` always point to the virtual environment, even when
1507
+ :mod: `site ` is disabled (:option: `-S `).
1490
1508
1491
1509
1492
1510
.. data :: ps1
0 commit comments