Skip to content
Snippets Groups Projects
Commit cfd8447f authored by Studer Gabriel's avatar Studer Gabriel
Browse files

set universal_newlines flag in Popen

This enables string encoding in passed streams => stdout and stderr
parent 6d4fec60
No related branches found
No related tags found
No related merge requests found
...@@ -80,7 +80,8 @@ def _RunTmAlign(tmalign, tmp_dir): ...@@ -80,7 +80,8 @@ def _RunTmAlign(tmalign, tmp_dir):
else: else:
tmalign_path=settings.Locate('tmalign', explicit_file_name=tmalign) tmalign_path=settings.Locate('tmalign', explicit_file_name=tmalign)
command="\"%s\" \"%s\" \"%s\" -m \"%s\"" %(tmalign_path, model1_filename, model2_filename, os.path.join(tmp_dir,'matrix.txt')) command="\"%s\" \"%s\" \"%s\" -m \"%s\"" %(tmalign_path, model1_filename, model2_filename, os.path.join(tmp_dir,'matrix.txt'))
ps=subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) ps=subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
universal_newlines=True)
ps.wait() ps.wait()
lines=ps.stdout.readlines() lines=ps.stdout.readlines()
if (len(lines))<22: if (len(lines))<22:
...@@ -128,7 +129,8 @@ def _RunMmAlign(mmalign, tmp_dir): ...@@ -128,7 +129,8 @@ def _RunMmAlign(mmalign, tmp_dir):
else: else:
mmalign_path=settings.Locate('MMalign', explicit_file_name=mmalign) mmalign_path=settings.Locate('MMalign', explicit_file_name=mmalign)
command="\"%s\" \"%s\" \"%s\"" %(mmalign_path, model1_filename, model2_filename) command="\"%s\" \"%s\" \"%s\"" %(mmalign_path, model1_filename, model2_filename)
ps=subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) ps=subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
universal_newlines=True)
ps.wait() ps.wait()
lines=ps.stdout.readlines() lines=ps.stdout.readlines()
if (len(lines))<22: if (len(lines))<22:
...@@ -205,7 +207,8 @@ def _RunTmScore(tmscore, tmp_dir): ...@@ -205,7 +207,8 @@ def _RunTmScore(tmscore, tmp_dir):
tmscore_path=settings.Locate('tmscore', explicit_file_name=tmscore) tmscore_path=settings.Locate('tmscore', explicit_file_name=tmscore)
command="\"%s\" \"%s\" \"%s\"" % (tmscore_path, model1_filename, command="\"%s\" \"%s\" \"%s\"" % (tmscore_path, model1_filename,
model2_filename) model2_filename)
ps=subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) ps=subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
universal_newlines=True)
ps.wait() ps.wait()
lines=ps.stdout.readlines() lines=ps.stdout.readlines()
if (len(lines))<22: if (len(lines))<22:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment