From 33e8b86a6ec1d167266b5df956d4a15f0660ddea Mon Sep 17 00:00:00 2001
From: Gabriel Studer <gabriel.studer@unibas.ch>
Date: Wed, 20 Nov 2019 17:00:32 +0100
Subject: [PATCH] set universal_newlines flag in Popen

This enables string encoding in passed streams => stdout and stderr
---
 modules/bindings/pymod/ialign.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/bindings/pymod/ialign.py b/modules/bindings/pymod/ialign.py
index 2c6090102..176a5dbe4 100644
--- a/modules/bindings/pymod/ialign.py
+++ b/modules/bindings/pymod/ialign.py
@@ -140,9 +140,12 @@ def _RuniAlign(ialign, tmp_dir, options={}):
   else:
     ialign_path=settings.Locate('ialign.pl', explicit_file_name=ialign)  
     command="\"%s\" \"%s\" \"%s\" %s" % (ialign_path, model1_filename, model2_filename, cmd_opts)
-  ps=subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
+
+  ps=subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
+                      universal_newlines=True)
   ps.wait()
   lines=ps.stdout.readlines()
+
   if (len(lines))<22:
     _CleanupFiles(tmp_dir)
     #for l in lines:
-- 
GitLab