]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Read binary file in add_log_file() for python3
authorJouni Malinen <j@w1.fi>
Sat, 2 Feb 2019 11:08:08 +0000 (13:08 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 4 Feb 2019 10:26:33 +0000 (12:26 +0200)
python3 requires sqlite3.Binary() input to be bytes instead of str, so
open the files for binary mode reading.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/run-tests.py

index be0edcb7a7c105eade6e56ea4c98e2b08b2dfa90..49e42cd78b4d2db763002c78c6a7ae9fd27079cf 100755 (executable)
@@ -84,7 +84,7 @@ def add_log_file(conn, test, run, type, path):
     if not os.path.exists(path):
         return
     contents = None
-    with open(path, 'r') as f:
+    with open(path, 'rb') as f:
         contents = f.read()
     if contents is None:
         return