mirror of
https://github.com/python/cpython.git
synced 2025-09-15 13:16:12 +00:00
GH-113568: Stop raising auditing events from pathlib ABCs (#113571)
Raise auditing events in `pathlib.Path.glob()`, `rglob()` and `walk()`, but not in `pathlib._abc.PathBase` methods. Also move generation of a deprecation warning into `pathlib.Path` so it gets the right stack level.
This commit is contained in:
parent
99854ce170
commit
3c4e972d6d
5 changed files with 64 additions and 35 deletions
|
@ -1703,6 +1703,18 @@ class PathTest(test_pathlib_abc.DummyPathTest, PurePathTest):
|
|||
with set_recursion_limit(recursion_limit):
|
||||
list(base.glob('**/'))
|
||||
|
||||
def test_glob_recursive_no_trailing_slash(self):
|
||||
P = self.cls
|
||||
p = P(self.base)
|
||||
with self.assertWarns(FutureWarning):
|
||||
p.glob('**')
|
||||
with self.assertWarns(FutureWarning):
|
||||
p.glob('*/**')
|
||||
with self.assertWarns(FutureWarning):
|
||||
p.rglob('**')
|
||||
with self.assertWarns(FutureWarning):
|
||||
p.rglob('*/**')
|
||||
|
||||
|
||||
@only_posix
|
||||
class PosixPathTest(PathTest, PurePosixPathTest):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue