tests: Read binary file in add_log_file() for python3

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>
This commit is contained in:
Jouni Malinen 2019-02-02 13:08:08 +02:00
parent 2a79a8ce14
commit 6395b9eb3e

View file

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