Skip to content

Commit bf0902f

Browse files
colesburyAlexWaygood
authored andcommitted
pythongh-121103: Update site module docs for free-threaded installs (pythonGH-122737)
(cherry picked from commit 1429651) Co-authored-by: Sam Gross <[email protected]> Co-authored-by: Alex Waygood <[email protected]>
1 parent 4aaa425 commit bf0902f

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

Doc/library/site.rst

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,22 @@ It starts by constructing up to four directories from a head and a tail part.
3232
For the head part, it uses ``sys.prefix`` and ``sys.exec_prefix``; empty heads
3333
are skipped. For the tail part, it uses the empty string and then
3434
:file:`lib/site-packages` (on Windows) or
35-
:file:`lib/python{X.Y}/site-packages` (on Unix and macOS). For each
35+
:file:`lib/python{X.Y[t]}/site-packages` (on Unix and macOS). (The
36+
optional suffix "t" indicates the :term:`free threading` build, and is
37+
appended if ``"t"`` is present in the :attr:`sys.abiflags` constant.)
38+
For each
3639
of the distinct head-tail combinations, it sees if it refers to an existing
3740
directory, and if so, adds it to ``sys.path`` and also inspects the newly
3841
added path for configuration files.
3942

4043
.. versionchanged:: 3.5
4144
Support for the "site-python" directory has been removed.
4245

46+
.. versionchanged:: 3.13
47+
On Unix, :term:`Free threading <free threading>` Python installations are
48+
identified by the "t" suffix in the version-specific directory name, such as
49+
:file:`lib/python3.13t/`.
50+
4351
If a file named "pyvenv.cfg" exists one directory above sys.executable,
4452
sys.prefix and sys.exec_prefix are set to that directory and
4553
it is also checked for site-packages (sys.base_prefix and
@@ -188,11 +196,12 @@ Module contents
188196

189197
Path to the user site-packages for the running Python. Can be ``None`` if
190198
:func:`getusersitepackages` hasn't been called yet. Default value is
191-
:file:`~/.local/lib/python{X.Y}/site-packages` for UNIX and non-framework
199+
:file:`~/.local/lib/python{X.Y}[t]/site-packages` for UNIX and non-framework
192200
macOS builds, :file:`~/Library/Python/{X.Y}/lib/python/site-packages` for macOS
193201
framework builds, and :file:`{%APPDATA%}\\Python\\Python{XY}\\site-packages`
194-
on Windows. This directory is a site directory, which means that
195-
:file:`.pth` files in it will be processed.
202+
on Windows. The optional "t" indicates the free-threaded build. This
203+
directory is a site directory, which means that :file:`.pth` files in it
204+
will be processed.
196205

197206

198207
.. data:: USER_BASE

0 commit comments

Comments
 (0)