审核事件表

该表包含整个 CPython 运行时和标准库中由sys.audit()PySys_Audit()调用引发的所有事件。这些呼叫是在 3.8.0 或更高版本中添加的。

有关处理这些事件的信息,请参见sys.addaudithook()PySys_AddAuditHook()

CPython 实现细节: 该表是从 CPython 文档生成的,可能不表示其他实现引发的事件。有关引发的实际事件,请参见您的运行时特定文档。

Audit eventArgumentsReferences
array.newtypecode , initializer[1]
builtins.breakpointbreakpointhook[1]
builtins.inputprompt[1]
builtins.input/resultresult[1]
code.newcode , filename , name , argcount , posonlyargcount , kwonlyargcount , nlocals , stacksize , flags[1]
compilesource , filename[1]
cpython.PyInterpreterState_Clear[1]
cpython.PyInterpreterState_New[1]
cpython._PySys_ClearAuditHooks[1]
cpython.run_commandcommand[1]
cpython.run_filefilename[1]
cpython.run_interactivehookhook[1]
cpython.run_modulemodule-name[1]
cpython.run_startupfilename[1]
cpython.run_stdin[1]
ctypes.addressofobj[1]
ctypes.call_functionfunc_pointer , arguments[1]
ctypes.cdataaddress[1]
ctypes.cdata/bufferpointer , size , offset[1][2]
ctypes.create_string_bufferinit , size[1]
ctypes.create_unicode_bufferinit , size[1]
ctypes.dlopenname[1]
ctypes.dlsymlibrary , name[1]
ctypes.dlsym/handlehandle , name[1]
ctypes.get_errno[1]
ctypes.get_last_error[1]
ctypes.seh_exceptioncode[1]
ctypes.set_errnoerrno[1]
ctypes.set_last_errorerror[1]
ctypes.string_ataddress , size[1]
ctypes.wstring_ataddress , size[1]
ensurepip.bootstraproot[1]
execcode_object[1][2]
fcntl.fcntlfd , cmd , arg[1]
fcntl.flockfd , operation[1]
fcntl.ioctlfd , request , arg[1]
fcntl.lockffd , cmd , len , start , whence[1]
ftplib.connectself , host , port[1]
ftplib.sendcmdself , cmd[1][2]
glob.globpathname , recursive[1][2]
imaplib.openself , host , port[1]
imaplib.sendself , data[1]
importmodule , filename , sys.path , sys.meta_path , sys.path_hooks[1]
mmap.newfileno , length , access , offset[1]
msvcrt.get_osfhandlefd[1]
msvcrt.lockingfd , mode , nbytes[1]
msvcrt.open_osfhandlehandle , flags[1]
nntplib.connectself , host , port[1][2]
nntplib.putlineself , line[1][2]
openfile , mode , flags[1][2][3]
os.add_dll_directorypath[1]
os.chdirpath[1][2]
os.chflagspath , flags[1][2]
os.chmodpath , mode , dir_fd[1][2][3]
os.chownpath , uid , gid , dir_fd[1][2][3]
os.execpath , args , env[1]
os.fork[1]
os.forkpty[1]
os.getxattrpath , attribute[1]
os.killpid , sig[1]
os.killpgpgid , sig[1]
os.linksrc , dst , src_dir_fd , dst_dir_fd[1]
os.listdirpath[1]
os.listxattrpath[1]
os.lockffd , cmd , len[1]
os.mkdirpath , mode , dir_fd[1][2]
os.posix_spawnpath , argv , env[1][2]
os.putenvkey , value[1]
os.removepath , dir_fd[1][2][3]
os.removexattrpath , attribute[1]
os.renamesrc , dst , src_dir_fd , dst_dir_fd[1][2][3]
os.rmdirpath , dir_fd[1]
os.scandirpath[1]
os.setxattrpath , attribute , value , flags[1]
os.spawnmode , path , args , env[1]
os.startfilepath , operation[1]
os.symlinksrc , dst , dir_fd[1]
os.systemcommand[1]
os.truncatefd , length[1][2]
os.unsetenvkey[1]
os.utimepath , times , ns , dir_fd[1]
pdb.Pdb[1]
pickle.find_classmodule , name[1]
poplib.connectself , host , port[1][2]
poplib.putlineself , line[1][2]
pty.spawnargv[1]
resource.prlimitpid , resource , limits[1]
resource.setrlimitresource , limits[1]
shutil.chownpath , user , group[1]
shutil.copyfilesrc , dst[1][2][3]
shutil.copymodesrc , dst[1][2]
shutil.copystatsrc , dst[1][2]
shutil.copytreesrc , dst[1]
shutil.make_archivebase_name , format , root_dir , base_dir[1]
shutil.movesrc , dst[1]
shutil.rmtreepath[1]
shutil.unpack_archivefilename , extract_dir , format[1]
signal.pthread_killthread_id , signalnum[1]
smtplib.connectself , host , port[1]
smtplib.sendself , data[1]
socket.newself , family , type , protocol[1]
socket.bindself , address[1]
socket.connectself , address[1][2]
socket.getaddrinfohost , port , family , type , protocol[1]
socket.gethostbyaddrip_address[1]
socket.gethostbynamehostname[1][2]
socket.gethostname[1]
socket.getnameinfosockaddr[1]
socket.getservbynameservicename , protocolname[1]
socket.getservbyportport , protocolname[1]
socket.sendmsgself , address[1]
socket.sendtoself , address[1]
socket.sethostnamename[1]
sqlite3.connectdatabase[1]
subprocess.Popenexecutable , args , cwd , env[1]
sys._current_frames[1]
sys._getframe[1]
sys.addaudithook[1][2]
sys.excepthookhook , type , value , traceback[1]
sys.set_asyncgen_hooks_finalizer[1]
sys.set_asyncgen_hooks_firstiter[1]
sys.setprofile[1]
sys.settrace[1]
sys.unraisablehookhook , unraisable[1]
syslog.closelog[1]
syslog.openlogident , logoption , facility[1]
syslog.setlogmaskmaskpri[1]
syslog.syslogpriority , message[1]
telnetlib.Telnet.openself , host , port[1]
telnetlib.Telnet.writeself , buffer[1]
tempfile.mkdtempfullpath[1][2]
tempfile.mkstempfullpath[1][2][3]
urllib.Requestfullurl , data , headers , method[1]
webbrowser.openurl[1]
winreg.ConnectRegistrycomputer_name , key[1]
winreg.CreateKeykey , sub_key , access[1][2]
winreg.DeleteKeykey , sub_key , access[1][2]
winreg.DeleteValuekey , value[1]
winreg.DisableReflectionKeykey[1]
winreg.EnableReflectionKeykey[1]
winreg.EnumKeykey , index[1]
winreg.EnumValuekey , index[1]
winreg.ExpandEnvironmentStringsstr[1]
winreg.LoadKeykey , sub_key , file_name[1]
winreg.OpenKeykey , sub_key , access[1]
winreg.OpenKey/resultkey[1][2][3]
winreg.PyHKEY.Detachkey[1]
winreg.QueryInfoKeykey[1]
winreg.QueryReflectionKeykey[1]
winreg.QueryValuekey , sub_key , value_name[1][2]
winreg.SaveKeykey , file_name[1]
winreg.SetValuekey , sub_key , type , value[1][2]