From b4abd1be6268bc97e74d2a12428c3a5dc9d29aeb Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 7 Dec 2023 20:57:30 +0000 Subject: [PATCH] gh-101100: Silence Sphinx warnings when `ntpath` or `posixpath` are referenced (#112833) --- Doc/conf.py | 4 ++++ Doc/library/pathlib.rst | 2 +- Doc/tools/.nitignore | 1 - Doc/whatsnew/3.7.rst | 6 +++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Doc/conf.py b/Doc/conf.py index 323d443588ceb63..f2d36fdc70430c0 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -166,6 +166,10 @@ # Deprecated function that was never documented: ('py:func', 'getargspec'), ('py:func', 'inspect.getargspec'), + # Undocumented modules that users shouldn't have to worry about + # (implementation details of `os.path`): + ('py:mod', 'ntpath'), + ('py:mod', 'posixpath'), ] # Temporary undocumented names. diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 62d4ed5e3f46b97..43200e269f56f4d 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -306,7 +306,7 @@ Pure paths provide the following methods and properties: .. attribute:: PurePath.pathmod The implementation of the :mod:`os.path` module used for low-level path - operations: either ``posixpath`` or ``ntpath``. + operations: either :mod:`posixpath` or :mod:`ntpath`. .. versionadded:: 3.13 diff --git a/Doc/tools/.nitignore b/Doc/tools/.nitignore index ada1fc5fafc9c93..8a033f019372f7f 100644 --- a/Doc/tools/.nitignore +++ b/Doc/tools/.nitignore @@ -72,7 +72,6 @@ Doc/library/multiprocessing.rst Doc/library/multiprocessing.shared_memory.rst Doc/library/numbers.rst Doc/library/optparse.rst -Doc/library/os.path.rst Doc/library/os.rst Doc/library/pickle.rst Doc/library/pickletools.rst diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index 99f280af84ab015..7a74f9c1685c312 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -2144,9 +2144,9 @@ The following features and APIs have been removed from Python 3.7: * Removed support of the *exclude* argument in :meth:`tarfile.TarFile.add`. It was deprecated in Python 2.7 and 3.2. Use the *filter* argument instead. -* The ``splitunc()`` function in the :mod:`ntpath` module was deprecated in - Python 3.1, and has now been removed. Use the :func:`~os.path.splitdrive` - function instead. +* The :func:`!ntpath.splitunc` function was deprecated in + Python 3.1, and has now been removed. Use :func:`~os.path.splitdrive` + instead. * :func:`collections.namedtuple` no longer supports the *verbose* parameter or ``_source`` attribute which showed the generated source code for the