This table contains all events raised by
or
calls throughout the CPython runtime and the standard library. These calls were added in 3.8 or later (see
).
See
and
for information on handling these events.
CPython implementation detail: This table is generated from the CPython documentation, and may not represent events raised by other implementations. See your runtime specific documentation for actual events raised.
Audit event
Arguments
References
_thread.start_new_thread
function, args, kwargs
array.__new__
typecode, initializer
builtins.breakpoint
breakpointhook
builtins.id
id
builtins.input
prompt
builtins.input/result
result
code.__new__
code, filename, name, argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize, flags
compile
source, filename
cpython.PyConfig_Set
name, value
cpython.PyInterpreterState_Clear
cpython.PyInterpreterState_New
cpython._PySys_ClearAuditHooks
cpython.remote_debugger_script
script_path
cpython.run_command
command
cpython.run_file
filename
cpython.run_interactivehook
hook
cpython.run_module
module-name
cpython.run_startup
filename
cpython.run_stdin
ctypes.addressof
obj
ctypes.call_function
func_pointer, arguments
ctypes.cdata
address
ctypes.cdata/buffer
pointer, size, offset
ctypes.create_string_buffer
init, size
ctypes.create_unicode_buffer
init, size
ctypes.dlopen
name
ctypes.dlsym
library, name
ctypes.dlsym/handle
handle, name
ctypes.get_errno
ctypes.get_last_error
ctypes.memoryview_at
address, size, readonly
ctypes.set_errno
errno
ctypes.set_exception
code
ctypes.set_last_error
error
ctypes.string_at
ptr, size
ctypes.wstring_at
ptr, size
ensurepip.bootstrap
root
exec
code_object
fcntl.fcntl
fd, cmd, arg
fcntl.flock
fd, operation
fcntl.ioctl
fd, request, arg
fcntl.lockf
fd, cmd, len, start, whence
ftplib.connect
self, host, port
ftplib.sendcmd
self, cmd
function.__new__
code
gc.get_objects
generation
gc.get_referents
objs
gc.get_referrers
objs
glob.glob
pathname, recursive
glob.glob/2
pathname, recursive, root_dir, dir_fd
http.client.connect
self, host, port
http.client.send
self, data
imaplib.open
self, host, port
imaplib.send
self, data
import
module, filename, sys.path, sys.meta_path, sys.path_hooks
marshal.dumps
value, version
marshal.load
marshal.loads
bytes
mmap.__new__
fileno, length, access, offset
msvcrt.get_osfhandle
fd
msvcrt.locking
fd, mode, nbytes
msvcrt.open_osfhandle
handle, flags
object.__delattr__
obj, name
object.__getattr__
obj, name
object.__setattr__
obj, name, value
open
path, mode, flags
os.add_dll_directory
path
os.chdir
path
os.chflags
path, flags
os.chmod
path, mode, dir_fd
os.chown
path, uid, gid, dir_fd
os.exec
path, args, env
os.fork
os.forkpty
os.fwalk
top, topdown, onerror, follow_symlinks, dir_fd
os.getxattr
path, attribute
os.kill
pid, sig
os.killpg
pgid, sig
os.link
src, dst, src_dir_fd, dst_dir_fd
os.listdir
path
os.listdrives
os.listmounts
volume
os.listvolumes
os.listxattr
path
os.lockf
fd, cmd, len
os.mkdir
path, mode, dir_fd
os.posix_spawn
path, argv, env
os.putenv
key, value
os.remove
path, dir_fd
os.removexattr
path, attribute
os.rename
src, dst, src_dir_fd, dst_dir_fd
os.rmdir
path, dir_fd
os.scandir
path
os.setxattr
path, attribute, value, flags
os.spawn
mode, path, args, env
os.startfile
path, operation
os.startfile/2
path, operation, arguments, cwd, show_cmd
os.symlink
src, dst, dir_fd
os.system
command
os.truncate
fd, length
os.unsetenv
key
os.utime
path, times, ns, dir_fd
os.walk
top, topdown, onerror, followlinks
pathlib.Path.glob
self, pattern
pathlib.Path.rglob
self, pattern
pdb.Pdb
pickle.find_class
module, name
poplib.connect
self, host, port
poplib.putline
self, line
pty.spawn
argv
resource.prlimit
pid, resource, limits
resource.setrlimit
resource, limits
setopencodehook
shutil.chown
path, user, group
shutil.copyfile
src, dst
shutil.copymode
src, dst
shutil.copystat
src, dst
shutil.copytree
src, dst
shutil.make_archive
base_name, format, root_dir, base_dir
shutil.move
src, dst
shutil.rmtree
path, dir_fd
shutil.unpack_archive
filename, extract_dir, format
signal.pthread_kill
thread_id, signalnum
smtplib.connect
self, host, port
smtplib.send
self, data
socket.__new__
self, family, type, protocol
socket.bind
self, address
socket.connect
self, address
socket.getaddrinfo
host, port, family, type, protocol
socket.gethostbyaddr
ip_address
socket.gethostbyname
hostname
socket.gethostname
socket.getnameinfo
sockaddr
socket.getservbyname
servicename, protocolname
socket.getservbyport
port, protocolname
socket.sendmsg
self, address
socket.sendto
self, address
socket.sethostname
name
sqlite3.connect
database
sqlite3.connect/handle
connection_handle
sqlite3.enable_load_extension
connection, enabled
sqlite3.load_extension
connection, path
subprocess.Popen
executable, args, cwd, env
sys._current_exceptions
sys._current_frames
sys._getframe
frame
sys._getframemodulename
depth
sys.addaudithook
sys.excepthook
hook, type, value, traceback
sys.monitoring.register_callback
func
sys.remote_exec
pid
sys.set_asyncgen_hooks_finalizer
sys.set_asyncgen_hooks_firstiter
sys.setprofile
sys.settrace
sys.unraisablehook
hook, unraisable
syslog.closelog
syslog.openlog
ident, logoption, facility
syslog.setlogmask
maskpri
syslog.syslog
priority, message
tempfile.mkdtemp
fullpath
tempfile.mkstemp
fullpath
time.sleep
seconds
urllib.Request
fullurl, data, headers, method
webbrowser.open
url
winreg.ConnectRegistry
computer_name, key
winreg.CreateKey
key, sub_key, access
winreg.DeleteKey
key, sub_key, access
winreg.DeleteValue
key, value
winreg.DisableReflectionKey
key
winreg.EnableReflectionKey
key
winreg.EnumKey
key, index
winreg.EnumValue
key, index
winreg.ExpandEnvironmentStrings
str
winreg.LoadKey
key, sub_key, file_name
winreg.OpenKey
key, sub_key, access
winreg.OpenKey/result
key
winreg.PyHKEY.Detach
key
winreg.QueryInfoKey
key
winreg.QueryReflectionKey
key
winreg.QueryValue
key, sub_key, value_name
winreg.SaveKey
key, file_name
winreg.SetValue
key, sub_key, type, value
The following events are raised internally and do not correspond to any public API of CPython:
Audit event
Arguments
_winapi.CreateFile
file_name, desired_access, share_mode, creation_disposition, flags_and_attributes
_winapi.CreateJunction
src_path, dst_path
_winapi.CreateNamedPipe
name, open_mode, pipe_mode
_winapi.CreatePipe
_winapi.CreateProcess
application_name, command_line, current_directory
_winapi.OpenProcess
process_id, desired_access
_winapi.TerminateProcess
handle, exit_code
_posixsubprocess.fork_exec
exec_list, args, env
ctypes.PyObj_FromPtr
obj
Added in version 3.14: The _posixsubprocess.fork_exec internal audit event.