Skip to content
Snippets Groups Projects
Commit 4bb22415 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 8d1a0447
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,8 @@ def GetVersion(msms_exe=None, msms_env=None):
"""
msms_executable = _GetExecutable(msms_exe, msms_env)
command = "%s" % (msms_executable)
proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
universal_newlines=True)
stdout_value, stderr_value = proc.communicate()
version = ""
......@@ -149,7 +150,8 @@ def _RunMSMS(command):
:returns: stdout of MSMS
:raises: :class:`CalledProcessError` for non-zero return value
"""
proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE)
proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
universal_newlines=True)
stdout_value, stderr_value = proc.communicate()
#check for successful completion of msms
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment