Skip to content

Commit a32f8fe

Browse files
authored
bpo-43756: Add new audit event for new arguments added to glob.glob (pythonGH-25239)
1 parent 7b86e47 commit a32f8fe

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Doc/library/glob.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ For example, ``'[?]'`` matches the character ``'?'``.
6565
match.
6666

6767
.. audit-event:: glob.glob pathname,recursive glob.glob
68+
.. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.glob
6869

6970
.. note::
7071
Using the "``**``" pattern in large directory trees may consume
@@ -83,6 +84,13 @@ For example, ``'[?]'`` matches the character ``'?'``.
8384
without actually storing them all simultaneously.
8485

8586
.. audit-event:: glob.glob pathname,recursive glob.iglob
87+
.. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.iglob
88+
89+
.. versionchanged:: 3.5
90+
Support for recursive globs using "``**``".
91+
92+
.. versionchanged:: 3.10
93+
Added the *root_dir* and *dir_fd* parameters.
8694

8795

8896
.. function:: escape(pathname)
@@ -128,4 +136,3 @@ default. For example, consider a directory containing :file:`card.gif` and
128136

129137
Module :mod:`fnmatch`
130138
Shell-style filename (not path) expansion
131-

Lib/glob.py

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False):
3434
zero or more directories and subdirectories.
3535
"""
3636
sys.audit("glob.glob", pathname, recursive)
37+
sys.audit("glob.glob/2", pathname, recursive, root_dir, dir_fd)
3738
if root_dir is not None:
3839
root_dir = os.fspath(root_dir)
3940
else:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add new audit event ``glob.glob/2`` to incorporate the new *root_dir* and
2+
*dir_fd* arguments added to :func:`glob.glob` and :func:`glob.iglob`.

0 commit comments

Comments
 (0)