@@ -896,7 +896,7 @@ call fails (for example because the path doesn't exist).
896
896
.. versionadded :: 3.5
897
897
898
898
899
- .. method :: Path.glob(pattern, *, case_sensitive=None)
899
+ .. method :: Path.glob(pattern, *, case_sensitive=None, follow_symlinks=None )
900
900
901
901
Glob the given relative *pattern * in the directory represented by this path,
902
902
yielding all matching files (of any kind)::
@@ -922,6 +922,11 @@ call fails (for example because the path doesn't exist).
922
922
typically, case-sensitive on POSIX, and case-insensitive on Windows.
923
923
Set *case_sensitive * to ``True `` or ``False `` to override this behaviour.
924
924
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
+
925
930
.. note ::
926
931
Using the "``** ``" pattern in large directory trees may consume
927
932
an inordinate amount of time.
@@ -935,6 +940,9 @@ call fails (for example because the path doesn't exist).
935
940
.. versionadded :: 3.12
936
941
The *case_sensitive * argument.
937
942
943
+ .. versionadded :: 3.13
944
+ The *follow_symlinks * argument.
945
+
938
946
.. method :: Path.group()
939
947
940
948
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).
1320
1328
.. versionadded :: 3.6
1321
1329
The *strict * argument (pre-3.6 behavior is strict).
1322
1330
1323
- .. method :: Path.rglob(pattern, *, case_sensitive=None)
1331
+ .. method :: Path.rglob(pattern, *, case_sensitive=None, follow_symlinks=None )
1324
1332
1325
1333
Glob the given relative *pattern * recursively. This is like calling
1326
1334
: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).
1338
1346
typically, case-sensitive on POSIX, and case-insensitive on Windows.
1339
1347
Set *case_sensitive * to ``True `` or ``False `` to override this behaviour.
1340
1348
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
+
1341
1354
.. audit-event :: pathlib.Path.rglob self,pattern pathlib.Path.rglob
1342
1355
1343
1356
.. versionchanged :: 3.11
@@ -1347,6 +1360,9 @@ call fails (for example because the path doesn't exist).
1347
1360
.. versionadded :: 3.12
1348
1361
The *case_sensitive * argument.
1349
1362
1363
+ .. versionadded :: 3.13
1364
+ The *follow_symlinks * argument.
1365
+
1350
1366
.. method :: Path.rmdir()
1351
1367
1352
1368
Remove this directory. The directory must be empty.
0 commit comments