From 4810b0240c86893f76d6a4f163476fc3ee34ad1c Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Fri, 14 Jun 2019 11:39:19 +0200 Subject: [PATCH] Flush the log file. This is to avoid mangling between the kiwix-build log (env variables, ...) and the command log. --- kiwixbuild/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kiwixbuild/utils.py b/kiwixbuild/utils.py index 8109863..0f2844a 100644 --- a/kiwixbuild/utils.py +++ b/kiwixbuild/utils.py @@ -245,6 +245,8 @@ def run_command(command, cwd, context, buildEnv=None, env=None, input=None, cros for k, v in env.items(): print(" {} : {!r}".format(k, v), file=log) + if log: + log.flush() kwargs = dict() if input: kwargs['stdin'] = subprocess.PIPE