Skip to content

Commit edd6f76

Browse files
authored
gh-161788: Document path-like support in shutil.which() (#162013)
1 parent cc98745 commit edd6f76

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎Doc/library/shutil.rst‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,9 @@ Directory and files operations
532532
or ends with an extension that is in ``PATHEXT``; and filenames that
533533
have no extension can now be found.
534534

535+
.. versionchanged:: next
536+
Accepts a :term:`path-like object` for *cmd*.
537+
535538
.. exception:: Error
536539

537540
Subclass of :exc:`OSError` collecting exceptions raised during a multi-file
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
Fix :func:`shutil.which` for path-like command objects whose
2-
:meth:`~os.PathLike.__fspath__` method returns :class:`bytes`.
1+
:func:`shutil.which` now accepts path-like objects for the command.

0 commit comments

Comments
 (0)