@@ -896,7 +896,7 @@ call fails (for example because the path doesn't exist).
896896 .. versionadded :: 3.5
897897
898898
899- .. method :: Path.glob(pattern, *, case_sensitive=None)
899+ .. method :: Path.glob(pattern, *, case_sensitive=None, follow_symlinks=None )
900900
901901 Glob the given relative *pattern * in the directory represented by this path,
902902 yielding all matching files (of any kind)::
@@ -922,6 +922,11 @@ call fails (for example because the path doesn't exist).
922922 typically, case-sensitive on POSIX, and case-insensitive on Windows.
923923 Set *case_sensitive * to ``True `` or ``False `` to override this behaviour.
924924
925+ By default, or when the *follow_symlinks * keyword-only argument is set to
926+ ``None ``, this method follows symlinks except when expanding "``** ``"
927+ wildcards. Set *follow_symlinks * to ``True `` to always follow symlinks, or
928+ ``False `` to treat all symlinks as files.
929+
925930 .. note ::
926931 Using the "``** ``" pattern in large directory trees may consume
927932 an inordinate amount of time.
@@ -935,6 +940,9 @@ call fails (for example because the path doesn't exist).
935940 .. versionadded :: 3.12
936941 The *case_sensitive * argument.
937942
943+ .. versionadded :: 3.13
944+ The *follow_symlinks * argument.
945+
938946.. method :: Path.group()
939947
940948 Return the name of the group owning the file. :exc: `KeyError ` is raised
@@ -1320,7 +1328,7 @@ call fails (for example because the path doesn't exist).
13201328 .. versionadded :: 3.6
13211329 The *strict * argument (pre-3.6 behavior is strict).
13221330
1323- .. method :: Path.rglob(pattern, *, case_sensitive=None)
1331+ .. method :: Path.rglob(pattern, *, case_sensitive=None, follow_symlinks=None )
13241332
13251333 Glob the given relative *pattern * recursively. This is like calling
13261334 :func: `Path.glob ` with "``**/ ``" added in front of the *pattern *, where
@@ -1338,6 +1346,11 @@ call fails (for example because the path doesn't exist).
13381346 typically, case-sensitive on POSIX, and case-insensitive on Windows.
13391347 Set *case_sensitive * to ``True `` or ``False `` to override this behaviour.
13401348
1349+ By default, or when the *follow_symlinks * keyword-only argument is set to
1350+ ``None ``, this method follows symlinks except when expanding "``** ``"
1351+ wildcards. Set *follow_symlinks * to ``True `` to always follow symlinks, or
1352+ ``False `` to treat all symlinks as files.
1353+
13411354 .. audit-event :: pathlib.Path.rglob self,pattern pathlib.Path.rglob
13421355
13431356 .. versionchanged :: 3.11
@@ -1347,6 +1360,9 @@ call fails (for example because the path doesn't exist).
13471360 .. versionadded :: 3.12
13481361 The *case_sensitive * argument.
13491362
1363+ .. versionadded :: 3.13
1364+ The *follow_symlinks * argument.
1365+
13501366.. method :: Path.rmdir()
13511367
13521368 Remove this directory. The directory must be empty.
0 commit comments