Skip to content

Commit

Permalink
Update subprocess calls from v1.8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Rurik committed Jan 21, 2023
1 parent cd0ac76 commit 47222e0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Noriben.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# Remove unneeded or obtuse options
# Move everything to all major settings to a configuration file
#
# Version 1.8.8 - 20 Jan 23
# Replaced subprocess .wait() to .communicate() due to known process exec issue
# which causes deadlocks in a small amount of cases
# Version 1.8.7 - 30 Aug 22
# Replaced csv.reader with csv.DictReader to have better forward and backward
# compatibility. Small changes in style, PEP8
Expand Down Expand Up @@ -698,8 +701,9 @@ def process_pml_to_csv(procmonexe, pml_file, pmc_file, csv_file):
if use_pmc and file_exists(pmc_file):
cmdline += ' /LoadConfig "{}"'.format(pmc_file)
log_debug('[*] Running cmdline: {}'.format(cmdline))
stdnull = subprocess.Popen(cmdline)
stdnull.wait()
process = subprocess.Popen(cmdline, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = process.communicate()

time_convert_end = time.time()
time_process = time_convert_end - time_convert_start
Expand Down Expand Up @@ -741,8 +745,9 @@ def terminate_procmon(procmonexe):

cmdline = '"{}" /Terminate'.format(procmonexe)
log_debug('[*] Running cmdline: {}'.format(cmdline))
stdnull = subprocess.Popen(cmdline)
stdnull.wait()
process = subprocess.Popen(cmdline, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = process.communicate()


def parse_csv(csv_file, report, timeline):
Expand Down

0 comments on commit 47222e0

Please sign in to comment.