Skip to content

bpo-43756: Add new audit event to incorporate new arguments added to glob.glob #25239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Doc/library/glob.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ For example, ``'[?]'`` matches the character ``'?'``.
match.

.. audit-event:: glob.glob pathname,recursive glob.glob
.. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.glob

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

.. audit-event:: glob.glob pathname,recursive glob.iglob
.. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.iglob

.. versionchanged:: 3.5
Support for recursive globs using "``**``".

.. versionchanged:: 3.10
Added the *root_dir* and *dir_fd* parameters.


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

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

1 change: 1 addition & 0 deletions Lib/glob.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False):
zero or more directories and subdirectories.
"""
sys.audit("glob.glob", pathname, recursive)
sys.audit("glob.glob/2", pathname, recursive, root_dir, dir_fd)
if root_dir is not None:
root_dir = os.fspath(root_dir)
else:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add new audit event ``glob.glob/2`` to incorporate the new *root_dir* and
*dir_fd* arguments added to :func:`glob.glob` and :func:`glob.iglob`.