From 91e7e9c0a078d70b053ebae3b08471049895131b Mon Sep 17 00:00:00 2001 From: Sakthipriyan Vairamani Date: Sun, 13 Sep 2015 01:24:57 +0530 Subject: [PATCH] tools: open `test.tap` file in write-binary mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By default the logfile is opened in append mode. This commit makes sure that the file is opened in write-binary mode, so that the file will be created if it doesn't exist or overwrite if it exists. Fixes: #2834 PR-URL: #2837 Reviewed-By: Johan Bergström Reviewed-By: Ben Noordhuis Reviewed-By: Rod Vagg Reviewed-By: Alexis Campailla --- tools/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test.py b/tools/test.py index 452b99edbc..59a31bf1cf 100755 --- a/tools/test.py +++ b/tools/test.py @@ -1418,7 +1418,7 @@ def Main(): logger.addHandler(ch) logger.setLevel(logging.INFO) if options.logfile: - fh = logging.FileHandler(options.logfile) + fh = logging.FileHandler(options.logfile, mode='wb') logger.addHandler(fh) workspace = abspath(join(dirname(sys.argv[0]), '..'))