https://github.com/python/cpython/commit/ff275f091b90056bbafd7a230f348532308bdca7
commit: ff275f091b90056bbafd7a230f348532308bdca7
branch: main
author: _andthereitgoes 
<[email protected]>
committer: FFY00 <[email protected]>
date: 2026-06-22T15:07:39+01:00
summary:

Correct typos in `runpy.run_path` documentation (#151230)

*file_path* -> *path_name* in runpy.rst

The documentation for runpy.run_path refers to a parameter called *file_path*, 
which doesn't exist in the call spec. However, *path_name* exists, and it is 
implied that *file_path* actually refers to *path_name*.

files:
M Doc/library/runpy.rst

diff --git a/Doc/library/runpy.rst b/Doc/library/runpy.rst
index 536b5980f86a81..d764a98c8419ed 100644
--- a/Doc/library/runpy.rst
+++ b/Doc/library/runpy.rst
@@ -106,7 +106,7 @@ The :mod:`!runpy` module provides two functions:
 
    Execute the code at the named filesystem location and return the resulting
    module's globals dictionary. As with a script name supplied to the CPython
-   command line, *file_path* may refer to a Python source file, a
+   command line, *path_name* may refer to a Python source file, a
    compiled bytecode file or a valid :data:`sys.path` entry containing a
    :mod:`__main__` module
    (e.g. a zipfile containing a top-level :file:`__main__.py` file).
@@ -134,12 +134,12 @@ The :mod:`!runpy` module provides two functions:
    ``__name__`` is set to *run_name* if this optional argument is not
    :const:`None` and to ``'<run_path>'`` otherwise.
 
-   If *file_path* directly references a script file (whether as source
+   If *path_name* directly references a script file (whether as source
    or as precompiled byte code), then ``__file__`` will be set to
-   *file_path*, and ``__spec__``, ``__loader__`` and
+   *path_name*, and ``__spec__``, ``__loader__`` and
    ``__package__`` will all be set to :const:`None`.
 
-   If *file_path* is a reference to a valid :data:`sys.path` entry, then
+   If *path_name* is a reference to a valid :data:`sys.path` entry, then
    ``__spec__`` will be set appropriately for the imported :mod:`__main__`
    module (that is, ``__spec__.name`` will always be ``__main__``).
    ``__file__``, ``__loader__`` and ``__package__`` will be
@@ -147,7 +147,7 @@ The :mod:`!runpy` module provides two functions:
 
    A number of alterations are also made to the :mod:`sys` module. Firstly,
    :data:`sys.path` may be altered as described above. ``sys.argv[0]`` is 
updated
-   with the value of *file_path* and ``sys.modules[__name__]`` is updated
+   with the value of *path_name* and ``sys.modules[__name__]`` is updated
    with a temporary module object for the module being executed. All
    modifications to items in :mod:`sys` are reverted before the function
    returns.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to