Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clarify docs for *follow_symlinks* argument
  • Loading branch information
barneygale committed Mar 14, 2023
commit 8d657eeaf421e3defee08fe5ff585bbd11a7cf65
14 changes: 8 additions & 6 deletions Doc/library/pathlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -873,8 +873,8 @@ call fails (for example because the path doesn't exist).
PosixPath('setup.py'),
PosixPath('test_pathlib.py')]

By default, :meth:`Path.glob` does not follow symlinks. Set
*follow_symlinks* to true to visit symlinks to directories.
By default, :meth:`Path.glob` does not follow symlinks when expanding a
pattern. Set *follow_symlinks* to true to visit symlinks to directories.

.. note::
Using the "``**``" pattern in large directory trees may consume
Expand All @@ -888,7 +888,8 @@ call fails (for example because the path doesn't exist).

.. versionchanged:: 3.12
The *follow_symlinks* parameter was added. In previous versions,
symlinks were followed except when expanding "``**``" wildcards.
symlinks were followed when expanding patterns, except when expanding
"``**``" wildcards.

.. method:: Path.group()

Expand Down Expand Up @@ -1288,8 +1289,8 @@ call fails (for example because the path doesn't exist).
PosixPath('setup.py'),
PosixPath('test_pathlib.py')]

By default, :meth:`Path.rglob` does not follow symlinks. Set
*follow_symlinks* to true to visit symlinks to directories.
By default, :meth:`Path.rglob` does not follow symlinks when expanding a
pattern. Set *follow_symlinks* to true to visit symlinks to directories.

.. audit-event:: pathlib.Path.rglob self,pattern pathlib.Path.rglob

Expand All @@ -1299,7 +1300,8 @@ call fails (for example because the path doesn't exist).

.. versionchanged:: 3.12
The *follow_symlinks* parameter was added. In previous versions,
symlinks were followed except when expanding "``**``" wildcards.
symlinks were followed when expanding patterns, except when expanding
"``**``" wildcards.

.. method:: Path.rmdir()

Expand Down