mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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:
parent
0ef8d921f5
commit
ea2f5bcda1
5 changed files with 42 additions and 0 deletions
|
@ -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
|
||||
--
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue