@@ -81,6 +81,7 @@ Summary -- Release highlights
8181 <whatsnew315-unpacking-in-comprehensions>`
8282* :pep: `686 `: :ref: `Python now uses UTF-8 as the default encoding
8383 <whatsnew315-utf8-default>`
84+ * :pep: `829 `: :ref: `Package startup configuration files <whatsnew315-startup-files >`
8485* :pep: `728 `: :ref: `TypedDict with typed extra items <whatsnew315-typeddict >`
8586* :pep: `747 `: :ref: `Annotating type forms with TypeForm
8687 <whatsnew315-typeform>`
@@ -94,7 +95,6 @@ Summary -- Release highlights
9495* :ref: `Improved error messages <whatsnew315-improved-error-messages >`
9596* :ref: `The official Windows 64-bit binaries now use the tail-calling interpreter
9697 <whatsnew315-windows-tail-calling-interpreter>`
97- * :pep: `829 `: Package Startup Configuration Files
9898
9999New features
100100============
@@ -452,6 +452,31 @@ agen() for x in a)``.
452452
453453(Contributed by Adam Hartz in :gh: `143055 `.)
454454
455+ .. _whatsnew315-startup-files :
456+
457+ :pep: `829 `: Package startup configuration files
458+ -----------------------------------------------
459+
460+ Loaded by the :mod: `site ` module when ``-S `` is not given, :ref: `.pth files <site-pth-files >`
461+ can contain lines that both extend :data: `sys.path ` and execute arbitrary code
462+ when the line starts with ``import `` (followed by a space or tab). The latter
463+ functionality can be problematic, since it is difficult to know exactly what
464+ gets executed when Python starts up.
465+
466+ As a step towards improving the ability to audit pre-start executable code,
467+ Python 3.15 introduces :ref: `.start files <site-start-files >` which contain entry point
468+ specifications of the form ``pkg.mod:callable `` where ``pkg.mod `` is the
469+ import path to the given callable. When Python starts up, the callable is
470+ located and called with no arguments.
471+
472+ ``import `` lines in :file: `.pth ` files are silently deprecated. When a
473+ matching :file: `.start ` file is found, ``import `` lines in :file: `.pth ` files
474+ are ignored. There is no change to :data: `sys.path ` extension lines in
475+ :file: `.pth ` files.
476+
477+ (Contributed by Barry Warsaw in :gh: `148641 `.)
478+
479+
455480.. _whatsnew315-abi3t :
456481
457482:pep: `803 ` -- Stable ABI for Free-Threaded Builds
0 commit comments