From abcff0c3b75bfb2d78749cf68f61b2c2013554bb Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Sun, 18 Aug 2024 14:03:42 +1100
Subject: [PATCH 3/4] read pipe as binary

---
 lapack_testing.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lapack_testing.py b/lapack_testing.py
index 8b0af0de1..a6ce1ae72 100755
--- a/lapack_testing.py
+++ b/lapack_testing.py
@@ -114,7 +114,7 @@ def run_summary_test( f, cmdline, short_summary):
             r=1
             if short_summary: return [nb_test_run,nb_test_fail,nb_test_illegal,nb_test_info]
         else:
-            pipe = open(cmdline,'r')
+            pipe = open(cmdline,'rb')
             r=0
     else:
         cmdline = os.path.join(abs_bin_dir, cmdline)
@@ -125,7 +125,7 @@ def run_summary_test( f, cmdline, short_summary):
         p.wait()
         #pipe.close()
         r=p.returncode
-        pipe = open(outfile,'r')
+        pipe = open(outfile,'rb')
         error_message=cmdline+" did not work"
 
     if r != 0 and not with_file:
@@ -140,18 +140,18 @@ def run_summary_test( f, cmdline, short_summary):
         for line in pipe.readlines():
             f.write(str(line))
             words_in_line=line.split()
-            if (line.find("run")!=-1):
+            if (line.find(b"run")!=-1):
 #                  print line
-                whereisrun=words_in_line.index("run)")
+                whereisrun=words_in_line.index(b"run)")
                 nb_test_run+=int(words_in_line[whereisrun-2])
-            if (line.find("out of")!=-1):
+            if (line.find(b"out of")!=-1):
                 if (short_summary==0): print(line, end=' ')
-                whereisout= words_in_line.index("out")
+                whereisout= words_in_line.index(b"out")
                 nb_test_fail+=int(words_in_line[whereisout-1])
-            if ((line.find("illegal")!=-1) or (line.find("Illegal")!=-1)):
+            if ((line.find(b"illegal")!=-1) or (line.find(b"Illegal")!=-1)):
                 if (short_summary==0):print(line, end=' ')
                 nb_test_illegal+=1
-            if (line.find(" INFO")!=-1):
+            if (line.find(b" INFO")!=-1):
                 if (short_summary==0):print(line, end=' ')
                 nb_test_info+=1
             if (with_file==1):
