diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2022-05-11 04:14:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-11 04:14:25 (GMT) |
commit | b1c4368824e5c2e4d4d5875f9c5f7a9c5a0d2ce2 (patch) | |
tree | 9666205baa9e05d5dceceab74f829daf74fb1aee /Doc | |
parent | dfdebda0524ce4cc945621d69eef77a64f260095 (diff) | |
download | cpython-b1c4368824e5c2e4d4d5875f9c5f7a9c5a0d2ce2.zip cpython-b1c4368824e5c2e4d4d5875f9c5f7a9c5a0d2ce2.tar.gz cpython-b1c4368824e5c2e4d4d5875f9c5f7a9c5a0d2ce2.tar.bz2 |
Revert "gh-92550 - Fix regression in `pathlib.Path.rglob()` (GH-92583)" (GH-92598)
This reverts commit dcdf250d2de1428f7d8b4e9ecf51d2fd8200e21a.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/pathlib.rst | 6 | ||||
-rw-r--r-- | Doc/whatsnew/3.11.rst | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 535b5ab..d45e7aa 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -815,6 +815,9 @@ call fails (for example because the path doesn't exist). .. audit-event:: pathlib.Path.glob self,pattern pathlib.Path.glob + .. versionchanged:: 3.11 + Return only directories if *pattern* ends with a pathname components + separator (:data:`~os.sep` or :data:`~os.altsep`). .. method:: Path.group() @@ -1104,6 +1107,9 @@ call fails (for example because the path doesn't exist). .. audit-event:: pathlib.Path.rglob self,pattern pathlib.Path.rglob + .. versionchanged:: 3.11 + Return only directories if *pattern* ends with a pathname components + separator (:data:`~os.sep` or :data:`~os.altsep`). .. method:: Path.rmdir() diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index db5ede6..40e68e6 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -559,6 +559,15 @@ os instead of ``CryptGenRandom()`` which is deprecated. (Contributed by Dong-hee Na in :issue:`44611`.) + +pathlib +------- + +* :meth:`~pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` return only + directories if *pattern* ends with a pathname components separator: + :data:`~os.sep` or :data:`~os.altsep`. + (Contributed by Eisuke Kawasima in :issue:`22276` and :issue:`33392`.) + re -- |