From b4a40ba8ca4c2ac9c698fa0df9b78e069b3aa19f Mon Sep 17 00:00:00 2001 From: Manuel Gunther Date: Tue, 6 Oct 2015 14:47:07 -0600 Subject: [PATCH] Solved python3 issue with IO --- bob/measure/openbr.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bob/measure/openbr.py b/bob/measure/openbr.py index 62ff8f1..36ee31e 100644 --- a/bob/measure/openbr.py +++ b/bob/measure/openbr.py @@ -235,16 +235,19 @@ def write_score_file( If ``None``, the values will not be written in the score file at all. """ def _read_matrix(filename): + py3 = sys.version_info[0] >=3 ## Helper function to read a matrix file as written by OpenBR with open(filename, 'rb') as f: # get version header = f.readline() + if py3: header = header.decode("utf-8") assert header[:2] == "S2" # skip gallery and probe files f.readline() f.readline() # read size and type of matrix size = f.readline() + if py3: size = size.decode("utf-8") splits = size.rstrip().split() # TODO: check the endianess of the magic number stored in split[3] assert splits[0][0] == 'M'