@@ -130,27 +130,26 @@ always available.
130130
131131.. data :: base_exec_prefix
132132
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.
141140
142141 .. versionadded :: 3.3
143142
144143
145144.. data :: base_prefix
146145
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 .
154153
155154 .. versionadded :: 3.3
156155
@@ -483,11 +482,19 @@ always available.
483482
484483 .. note ::
485484
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 .
490489
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 `).
491498
492499.. data :: executable
493500
@@ -1483,10 +1490,21 @@ always available.
14831490 argument to the :program: `configure ` script. See
14841491 :ref: `installation_paths ` for derived paths.
14851492
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 `).
14901508
14911509
14921510.. data :: ps1
0 commit comments