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/whatsnew | |
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/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.11.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index b2b9874..5f1f995 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -506,6 +506,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 -- |