https://github.com/python/cpython/commit/edd6f7692ad1bb30ba48dc74e0488cef074e402c
commit: edd6f7692ad1bb30ba48dc74e0488cef074e402c
branch: main
author: Olayinka Vaughan <[email protected]>
committer: picnixz <[email protected]>
date: 2026-11-14T23:53:42Z
summary:
gh-161788: Document path-like support in shutil.which() (#162013)
files:
M Doc/library/shutil.rst
M Misc/NEWS.d/next/Library/2026-11-10-23-51-25.gh-issue-161788.J8vQmK.rst
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.
_______________________________________________
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]