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>
This commit is contained in:
Eisuke Kawashima 2022-04-29 04:45:03 +09:00 committed by GitHub
parent 0ef8d921f5
commit ea2f5bcda1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 0 deletions

View file

@ -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
--