下表包含了在整个 Cpython 运行时和标准库中由 sys.audit() 或 PySys_Audit() 调用所引发的全部事件。 这些调用是在 3.8.0 或更高版本中添加了 (参见 PEP 578)。

为长洲等地区用户提供了全套网页设计制作服务,及长洲网站建设行业解决方案。主营业务为网站设计、成都网站建设、长洲网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!
请参阅 sys.addaudithook() 和 PySys_AddAuditHook() 了解有关处理这些事件的详细信息。
CPython 实现细节: 此表是根据 CPython 文档生成的,可能无法表示其他实现所引发的事件。 请参阅你的运行时专属的文档了解实际引发的事件。
| 
 Audit event  | 
 Arguments  | 
 References  | 
|---|---|---|
array.new  | 
  | [1]  | 
builtins.breakpoint  | 
  | [1]  | 
builtins.id  | 
  | [1]  | 
builtins.input  | 
  | [1]  | 
builtins.input/result  | 
  | [1]  | 
code.new  | 
  | [1]  | 
compile  | 
  | [1]  | 
cpython.PyInterpreterStateClear  | [1]  | |
cpython.PyInterpreterStateNew  | [1]  | |
cpython.PySysClearAuditHooks  | [1]  | |
cpython.runcommand  | 
  | [1]  | 
cpython.runfile  | 
  | [1]  | 
cpython.runinteractivehook  | 
  | [1]  | 
cpython.runmodule  | 
  | [1]  | 
cpython.runstartup  | 
  | [1]  | 
cpython.runstdin  | [1]  | |
ctypes.addressof  | 
  | [1]  | 
ctypes.callfunction  | 
  | [1]  | 
ctypes.cdata  | 
  | [1]  | 
ctypes.cdata/buffer  | 
  | [1][2]  | 
ctypes.createstringbuffer  | 
  | [1]  | 
ctypes.createunicodebuffer  | 
  | [1]  | 
ctypes.dlopen  | 
  | [1]  | 
ctypes.dlsym  | 
  | [1]  | 
ctypes.dlsym/handle  | 
  | [1]  | 
ctypes.geterrno  | [1]  | |
ctypes.getlast_error  | [1]  | |
ctypes.seh_exception  | 
  | [1]  | 
ctypes.set_errno  | 
  | [1]  | 
ctypes.set_last_error  | 
  | [1]  | 
ctypes.string_at  | 
  | [1]  | 
ctypes.wstring_at  | 
  | [1]  | 
ensurepip.bootstrap  | 
  | [1]  | 
exec  | 
  | [1][2]  | 
fcntl.fcntl  | 
  | [1]  | 
fcntl.flock  | 
  | [1]  | 
fcntl.ioctl  | 
  | [1]  | 
fcntl.lockf  | 
  | [1]  | 
ftplib.connect  | 
  | [1]  | 
ftplib.sendcmd  | 
  | [1][2]  | 
function.__new  | 
  | [1]  | 
gc.get_objects  | 
  | [1]  | 
gc.get_referents  | 
  | [1]  | 
gc.get_referrers  | 
  | [1]  | 
glob.glob  | 
  | [1][2]  | 
glob.glob/2  | 
  | [1][2]  | 
http.client.connect  | 
  | [1]  | 
http.client.send  | 
  | [1]  | 
imaplib.open  | 
  | [1]  | 
imaplib.send  | 
  | [1]  | 
import  | 
  | [1]  | 
marshal.dumps  | 
  | [1]  | 
marshal.load  | [1]  | |
marshal.loads  | 
  | [1]  | 
mmap.__new  | 
  | [1]  | 
msvcrt.get_osfhandle  | 
  | [1]  | 
msvcrt.locking  | 
  | [1]  | 
msvcrt.open_osfhandle  | 
  | [1]  | 
nntplib.connect  | 
  | [1][2]  | 
nntplib.putline  | 
  | [1][2]  | 
object.__delattr  | 
  | |
object.__getattr  | 
  | |
object.__setattr  | 
  | |
open  | 
  | [1][2][3]  | 
os.add_dll_directory  | 
  | [1]  | 
os.chdir  | 
  | [1][2]  | 
os.chflags  | 
  | [1][2]  | 
os.chmod  | 
  | [1][2][3]  | 
os.chown  | 
  | [1][2][3]  | 
os.exec  | 
  | [1]  | 
os.fork  | [1]  | |
os.forkpty  | [1]  | |
os.fwalk  | 
  | [1]  | 
os.getxattr  | 
  | [1]  | 
os.kill  | 
  | [1]  | 
os.killpg  | 
  | [1]  | 
os.link  | 
  | [1]  | 
os.listdir  | 
  | [1]  | 
os.listxattr  | 
  | [1]  | 
os.lockf  | 
  | [1]  | 
os.mkdir  | 
  | [1][2]  | 
os.posix_spawn  | 
  | [1][2]  | 
os.putenv  | 
  | [1]  | 
os.remove  | 
  | [1][2][3]  | 
os.removexattr  | 
  | [1]  | 
os.rename  | 
  | [1][2][3]  | 
os.rmdir  | 
  | [1]  | 
os.scandir  | 
  | [1]  | 
os.setxattr  | 
  | [1]  | 
os.spawn  | 
  | [1]  | 
os.startfile  | 
  | [1]  | 
os.startfile/2  | 
  | [1]  | 
os.symlink  | 
  | [1]  | 
os.system  | 
  | [1]  | 
os.truncate  | 
  | [1][2]  | 
os.unsetenv  | 
  | [1]  | 
os.utime  | 
  | [1]  | 
os.walk  | 
  | [1]  | 
pathlib.Path.glob  | 
  | [1]  | 
pathlib.Path.rglob  | 
  | [1]  | 
pdb.Pdb  | [1]  | |
pickle.find_class  | 
  | [1]  | 
poplib.connect  | 
  | [1][2]  | 
poplib.putline  | 
  | [1][2]  | 
pty.spawn  | 
  | [1]  | 
resource.prlimit  | 
  | [1]  | 
resource.setrlimit  | 
  | [1]  | 
setopencodehook  | [1]  | |
shutil.chown  | 
  | [1]  | 
shutil.copyfile  | 
  | [1][2][3]  | 
shutil.copymode  | 
  | [1][2]  | 
shutil.copystat  | 
  | [1][2]  | 
shutil.copytree  | 
  | [1]  | 
shutil.make_archive  | 
  | [1]  | 
shutil.move  | 
  | [1]  | 
shutil.rmtree  | 
  | [1]  | 
shutil.unpack_archive  | 
  | [1]  | 
signal.pthread_kill  | 
  | [1]  | 
smtplib.connect  | 
  | [1]  | 
smtplib.send  | 
  | [1]  | 
socket.__new  | 
  | [1]  | 
socket.bind  | 
  | [1]  | 
socket.connect  | 
  | [1][2]  | 
socket.getaddrinfo  | 
  | [1]  | 
socket.gethostbyaddr  | 
  | [1]  | 
socket.gethostbyname  | 
  | [1][2]  | 
socket.gethostname  | [1]  | |
socket.getnameinfo  | 
  | [1]  | 
socket.getservbyname  | 
  | [1]  | 
socket.getservbyport  | 
  | [1]  | 
socket.sendmsg  | 
  | [1]  | 
socket.sendto  | 
  | [1]  | 
socket.sethostname  | 
  | [1]  | 
sqlite3.connect  | 
  | [1]  | 
sqlite3.connect/handle  | 
  | [1]  | 
sqlite3.enable_load_extension  | 
  | [1]  | 
sqlite3.load_extension  | 
  | [1]  | 
subprocess.Popen  | 
  | [1]  | 
sys._current_exceptions  | [1]  | |
sys._current_frames  | [1]  | |
sys._getframe  | 
  | [1]  | 
sys.addaudithook  | [1][2]  | |
sys.excepthook  | 
  | [1]  | 
sys.set_asyncgen_hooks_finalizer  | [1]  | |
sys.set_asyncgen_hooks_firstiter  | [1]  | |
sys.setprofile  | [1]  | |
sys.settrace  | [1]  | |
sys.unraisablehook  | 
  | [1]  | 
syslog.closelog  | [1]  | |
syslog.openlog  | 
  | [1]  | 
syslog.setlogmask  | 
  | [1]  | 
syslog.syslog  | 
  | [1]  | 
telnetlib.Telnet.open  | 
  | [1]  | 
telnetlib.Telnet.write  | 
  | [1]  | 
tempfile.mkdtemp  | 
  | [1][2]  | 
tempfile.mkstemp  | 
  | [1][2][3]  | 
urllib.Request  | 
  | [1]  | 
webbrowser.open  | 
  | [1]  | 
winreg.ConnectRegistry  | 
  | [1]  | 
winreg.CreateKey  | 
  | [1][2]  | 
winreg.DeleteKey  | 
  | [1][2]  | 
winreg.DeleteValue  | 
  | [1]  | 
winreg.DisableReflectionKey  | 
  | [1]  | 
winreg.EnableReflectionKey  | 
  | [1]  | 
winreg.EnumKey  | 
  | [1]  | 
winreg.EnumValue  | 
  | [1]  | 
winreg.ExpandEnvironmentStrings  | 
  | [1]  | 
winreg.LoadKey  | 
  | [1]  | 
winreg.OpenKey  | 
  | [1]  | 
winreg.OpenKey/result  | 
  | [1][2][3]  | 
winreg.PyHKEY.Detach  | 
  | [1]  | 
winreg.QueryInfoKey  | 
  | [1]  | 
winreg.QueryReflectionKey  | 
  | [1]  | 
winreg.QueryValue  | 
  | [1][2]  | 
winreg.SaveKey  | 
  | [1]  | 
winreg.SetValue  | 
  | [1][2]  | 
下列事件只在内部被引发,而不会回应任何 CPython 公共 API:
| 
 审计事件  | 
 实参  | 
|---|---|
_winapi.CreateFile  | 
  | 
_winapi.CreateJunction  | 
  | 
_winapi.CreateNamedPipe  | 
  | 
_winapi.CreatePipe  | |
_winapi.CreateProcess  | 
  | 
_winapi.OpenProcess  | 
  | 
_winapi.TerminateProcess  | 
  | 
ctypes.PyObj_FromPtr  | 
  |