@@ -79,6 +79,7 @@ Summary -- Release highlights
7979 <whatsnew315-unpacking-in-comprehensions>`
8080* :pep: `686 `: :ref: `Python now uses UTF-8 as the default encoding
8181 <whatsnew315-utf8-default>`
82+ * :pep: `829 `: :ref: `Package startup configuration files <whatsnew315-startup-files >`
8283* :pep: `728 `: ``TypedDict `` with typed extra items
8384* :pep: `747 `: :ref: `Annotating type forms with TypeForm
8485 <whatsnew315-typeform>`
@@ -91,7 +92,6 @@ Summary -- Release highlights
9192* :ref: `Improved error messages <whatsnew315-improved-error-messages >`
9293* :ref: `The official Windows 64-bit binaries now use the tail-calling interpreter
9394 <whatsnew315-windows-tail-calling-interpreter>`
94- * :pep: `829 `: :ref: `Package startup configuration files <whatsnew315-startup-files >`
9595
9696New features
9797============
@@ -416,6 +416,31 @@ agen() for x in a)``.
416416
417417(Contributed by Adam Hartz in :gh: `143055 `.)
418418
419+ .. _whatsnew315-startup-files :
420+
421+ :pep: `829 `: Package startup configuration files
422+ -----------------------------------------------
423+
424+ Loaded by the :mod: `site ` module when ``-S `` is not given, :file: `.pth ` files
425+ can contain lines that both extend :data: `sys.path ` and execute arbitrary code
426+ when the line starts with ``import `` (followed by a space or tab). The latter
427+ functionality can be problematic, since it is difficult to know exactly what
428+ gets executed when Python starts up.
429+
430+ As a step towards improving the ability to audit pre-start executable code,
431+ Python 3.15 introduces :file: `.start ` files which contain entry point
432+ specifications of the form ``pkg.mod:callable `` where ``pkg.mod `` is the
433+ import path to the given callable. When Python starts up, the callable is
434+ located and called with no arguments.
435+
436+ ``import `` lines in :file: `.pth ` files are silently deprecated. When a
437+ matching :file: `.start ` file is found, ``import `` lines in :file: `.pth ` files
438+ are ignored. There is no change to :data: `sys.path ` extension lines in
439+ :file: `.pth ` files.
440+
441+ (Contributed by Barry Warsaw in :gh: `148641 `.)
442+
443+
419444.. _whatsnew315-abi3t :
420445
421446:pep: `803 `: ``abi3t `` -- Stable ABI for Free-Threaded Builds
@@ -452,31 +477,6 @@ If not using a build tool -- or when writing such a tool -- you can select
452477in :ref: `abi3-compiling `.
453478
454479
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, :file: `.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 :file: `.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-
480480.. _whatsnew315-improved-error-messages :
481481
482482Improved error messages
0 commit comments