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

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

diff --git a/modules/bindings/pymod/naccess.py b/modules/bindings/pymod/naccess.py
index dc65ab4ef..d2592c6b2 100644
--- a/modules/bindings/pymod/naccess.py
+++ b/modules/bindings/pymod/naccess.py
@@ -192,7 +192,7 @@ def _RunACCALL(command, temp_dir, query):
   """
   proc = subprocess.Popen(command, stdout=subprocess.PIPE,
                           stderr=subprocess.PIPE, stdin=subprocess.PIPE,
-                          cwd=temp_dir)
+                          cwd=temp_dir, universal_newlines=True)
   stdout_value, stderr_value = proc.communicate(query)
 
   # check for successful completion of naccess
@@ -215,7 +215,7 @@ def _RunNACCESS(command, temp_dir):
   :exception:      CalledProcessError for non-zero return value
   """
   proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
-                          cwd=temp_dir)
+                          cwd=temp_dir, universal_newlines=True)
   stdout_value, stderr_value = proc.communicate()
 
   # check for successful completion of naccess
-- 
GitLab