@@ -91,7 +91,7 @@ Summary -- Release highlights
9191* :ref: `Improved error messages <whatsnew315-improved-error-messages >`
9292* :ref: `The official Windows 64-bit binaries now use the tail-calling interpreter
9393 <whatsnew315-windows-tail-calling-interpreter>`
94- * :pep: `829 `: Package Startup Configuration Files
94+ * :pep: `829 `: :ref: ` Package Startup Configuration Files < whatsnew315-startup-files >`
9595
9696New features
9797============
@@ -449,6 +449,31 @@ If not using a build tool -- or when writing such a tool -- you can select
449449in :ref: `abi3-compiling `.
450450
451451
452+ .. _whatsnew315-startup-files :
453+
454+ :pep: `829 `: Startup Configuration Files
455+ ---------------------------------------
456+
457+ Loaded by the :mod: `site ` module when ``-S `` is not given, :file: `.pth ` files
458+ can contain lines that both extend :data: `sys.path ` and execute arbitrary code
459+ when the line starts with ``import `` (followed by a space or tab). The latter
460+ functionality can be problematic, since it is difficult to know exactly what
461+ gets executed when Python starts up.
462+
463+ As a step towards improving the ability to audit pre-start executable code,
464+ Python 3.15 introduces :file: `.start ` files which contain entry point
465+ specifications of the form ``pkg.mod:callable `` where ``pkg.mod `` is the
466+ import path to the given callable. When Python starts up, the callable is
467+ located and called with no arguments.
468+
469+ ``import `` lines in :file: `.pth ` files are silently deprecated. When a
470+ matching :file: `.start ` file is found, ``import `` lines in :file: `.pth ` files
471+ are ignored. There is no change to :data: `sys.path ` extension lines in
472+ :file: `.pth ` files.
473+
474+ (Contributed by Barry Warsaw in :gh: `148641 `.)
475+
476+
452477.. _whatsnew315-improved-error-messages :
453478
454479Improved error messages
0 commit comments