mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
bpo-37363: Add audit events for a range of modules (GH-14301)
This commit is contained in:
parent
9bbf4d7083
commit
60419a7e96
37 changed files with 165 additions and 18 deletions
|
@ -530,6 +530,7 @@ def copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2,
|
|||
function that supports the same signature (like copy()) can be used.
|
||||
|
||||
"""
|
||||
sys.audit("shutil.copytree", src, dst)
|
||||
with os.scandir(src) as entries:
|
||||
return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
|
||||
ignore=ignore, copy_function=copy_function,
|
||||
|
@ -640,6 +641,7 @@ def rmtree(path, ignore_errors=False, onerror=None):
|
|||
is false and onerror is None, an exception is raised.
|
||||
|
||||
"""
|
||||
sys.audit("shutil.rmtree", path)
|
||||
if ignore_errors:
|
||||
def onerror(*args):
|
||||
pass
|
||||
|
@ -965,6 +967,7 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
|
|||
'owner' and 'group' are used when creating a tar archive. By default,
|
||||
uses the current owner and group.
|
||||
"""
|
||||
sys.audit("shutil.make_archive", base_name, format, root_dir, base_dir)
|
||||
save_cwd = os.getcwd()
|
||||
if root_dir is not None:
|
||||
if logger is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue