diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 6104ad3d3a801b..db484beaf4b2ab 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -532,6 +532,9 @@ Directory and files operations or ends with an extension that is in ``PATHEXT``; and filenames that have no extension can now be found. + .. versionchanged:: next + Accepts a :term:`path-like object` for *cmd*. + .. exception:: Error Subclass of :exc:`OSError` collecting exceptions raised during a multi-file diff --git a/Misc/NEWS.d/next/Library/2026-11-10-23-51-25.gh-issue-161788.J8vQmK.rst b/Misc/NEWS.d/next/Library/2026-11-10-23-51-25.gh-issue-161788.J8vQmK.rst index 21565e386cd3cc..34d3cff85123c7 100644 --- a/Misc/NEWS.d/next/Library/2026-11-10-23-51-25.gh-issue-161788.J8vQmK.rst +++ b/Misc/NEWS.d/next/Library/2026-11-10-23-51-25.gh-issue-161788.J8vQmK.rst @@ -1,2 +1 @@ -Fix :func:`shutil.which` for path-like command objects whose -:meth:`~os.PathLike.__fspath__` method returns :class:`bytes`. +:func:`shutil.which` now accepts path-like objects for the command.