]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Mark log files to use utf-8 encoding
authorJouni Malinen <jouni@codeaurora.org>
Mon, 18 Feb 2019 16:19:06 +0000 (18:19 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 18 Feb 2019 16:19:06 +0000 (18:19 +0200)
This seems to be needed when using python3 in VM for the ssid_utf8 test
case debug prints from the control interface requests. This breaks
python2 support for the same logging entries, but there does not seem to
be any easy way of addressing this in a manner that works for both
python versions, so move ahead with the python3-only support from now
on.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/run-tests.py

index 2fe8ed866923158cb152a25d22b46242d539c585..2b8d4d25e319086bfd67422403b720a62cb2b90c 100755 (executable)
@@ -333,7 +333,7 @@ def main():
     logger.addHandler(stdout_handler)
 
     file_name = os.path.join(args.logdir, 'run-tests.log')
-    log_handler = logging.FileHandler(file_name)
+    log_handler = logging.FileHandler(file_name, encoding='utf-8')
     log_handler.setLevel(logging.DEBUG)
     fmt = "%(asctime)s %(levelname)s %(message)s"
     log_formatter = logging.Formatter(fmt)
@@ -460,7 +460,7 @@ def main():
             log_handler.stream.close()
             logger.removeHandler(log_handler)
             file_name = os.path.join(args.logdir, name + '.log')
-            log_handler = logging.FileHandler(file_name)
+            log_handler = logging.FileHandler(file_name, encoding='utf-8')
             log_handler.setLevel(logging.DEBUG)
             log_handler.setFormatter(log_formatter)
             logger.addHandler(log_handler)
@@ -630,7 +630,7 @@ def main():
         log_handler.stream.close()
         logger.removeHandler(log_handler)
         file_name = os.path.join(args.logdir, 'run-tests.log')
-        log_handler = logging.FileHandler(file_name)
+        log_handler = logging.FileHandler(file_name, encoding='utf-8')
         log_handler.setLevel(logging.DEBUG)
         log_handler.setFormatter(log_formatter)
         logger.addHandler(log_handler)