mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -1268,6 +1268,11 @@ class Popen(object):
|
|||
comspec = os.environ.get("COMSPEC", "cmd.exe")
|
||||
args = '{} /c "{}"'.format (comspec, args)
|
||||
|
||||
if cwd is not None:
|
||||
cwd = os.fsdecode(cwd)
|
||||
|
||||
sys.audit("subprocess.Popen", executable, args, cwd, env)
|
||||
|
||||
# Start the process
|
||||
try:
|
||||
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
|
||||
|
@ -1276,7 +1281,7 @@ class Popen(object):
|
|||
int(not close_fds),
|
||||
creationflags,
|
||||
env,
|
||||
os.fsdecode(cwd) if cwd is not None else None,
|
||||
cwd,
|
||||
startupinfo)
|
||||
finally:
|
||||
# Child is launched. Close the parent's copy of those pipe
|
||||
|
@ -1543,6 +1548,8 @@ class Popen(object):
|
|||
if executable is None:
|
||||
executable = args[0]
|
||||
|
||||
sys.audit("subprocess.Popen", executable, args, cwd, env)
|
||||
|
||||
if (_USE_POSIX_SPAWN
|
||||
and os.path.dirname(executable)
|
||||
and preexec_fn is None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue