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:
Barney Gale 2024-01-05 21:41:19 +00:00 committed by GitHub
parent 99854ce170
commit 3c4e972d6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 64 additions and 35 deletions

View file

@ -1266,19 +1266,6 @@ class DummyPathTest(DummyPurePathTest):
bad_link.symlink_to("bad" * 200)
self.assertEqual(sorted(base.glob('**/*')), [bad_link])
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('*/**')
def test_readlink(self):
if not self.can_symlink:
self.skipTest("symlinks required")