diff options
author | Eisuke Kawashima <e-kwsm@users.noreply.github.com> | 2022-04-28 19:45:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-28 19:45:03 (GMT) |
commit | ea2f5bcda1a392804487e6883be89fbad38a01a5 (patch) | |
tree | 9aa400b03250297948bce5eede3d13075f15fad9 /Doc/library/pathlib.rst | |
parent | 0ef8d921f5c6945aa8f386e472c4110b81ac773d (diff) | |
download | cpython-ea2f5bcda1a392804487e6883be89fbad38a01a5.zip cpython-ea2f5bcda1a392804487e6883be89fbad38a01a5.tar.gz cpython-ea2f5bcda1a392804487e6883be89fbad38a01a5.tar.bz2 |
bpo-22276: Change pathlib.Path.glob not to ignore trailing path separator (GH-10349)
Now pathlib.Path.glob() **only** matches directories when the pattern ends in a path separator.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Doc/library/pathlib.rst')
-rw-r--r-- | Doc/library/pathlib.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 01e9cfb..ab26e2f 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() |