Skip to content

Commit ba7dd6b

Browse files
gh-144329: Clarify that ._pth files are Windows-only in site docs
1 parent 5f57f69 commit ba7dd6b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Doc/library/site.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,18 @@ directory rather than a file. No item is added to ``sys.path`` more than
7878
once. Blank lines and lines beginning with ``#`` are skipped. Lines starting
7979
with ``import`` (followed by space or tab) are executed.
8080

81+
.. note::
82+
On Windows, a file whose name has the form :file:`._pth` is handled
83+
differently; it is used by the Windows-only "embeddable distribution"
84+
to provide a self-contained Python environment. See
85+
:ref:`finding_modules` for more details.
86+
8187
.. note::
8288

8389
An executable line in a :file:`.pth` file is run at every Python startup,
8490
regardless of whether a particular module is actually going to be used.
8591
Its impact should thus be kept to a minimum.
86-
The primary intended purpose of executable lines is to make the
87-
corresponding module(s) importable
88-
(load 3rd-party import hooks, adjust :envvar:`PATH` etc).
89-
Any other initialization is supposed to be done upon a module's
90-
actual import, if and when it happens.
91-
Limiting a code chunk to a single line is a deliberate measure
92-
to discourage putting anything more complex here.
93-
92+
9493
.. versionchanged:: 3.13
9594
The :file:`.pth` files are now decoded by UTF-8 at first and then by the
9695
:term:`locale encoding` if it fails.

0 commit comments

Comments
 (0)