diff --git a/ogs5py/ogs.py b/ogs5py/ogs.py index 081718e..eece481 100644 --- a/ogs5py/ogs.py +++ b/ogs5py/ogs.py @@ -1144,15 +1144,16 @@ def run_model( " ".join(args), timeout=timeout, logfile=out, + encoding=out.encoding, cwd=os.path.abspath(self.task_root), ) # wait for ogs to finish child.expect(pexpect.EOF) + child.close() + success = child.exitstatus == 0 # close the output stream out.close() - success = "Simulation time" in out.last_line - if not save_log: os.remove(log)