Skip to content

Commit cc3ab3c

Browse files
committed
added ISO decoding for stderr/stdout to address py3 issue
1 parent 581a698 commit cc3ab3c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

nipype/interfaces/base.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,9 +1271,16 @@ def _process(drain=0):
12711271
if output == 'allatonce':
12721272
stdout, stderr = proc.communicate()
12731273
if stdout and isinstance(stdout, bytes):
1274-
stdout = stdout.decode()
1274+
try:
1275+
stdout = stdout.decode()
1276+
except:
1277+
stdout = stdout.decode("ISO-8859-1")
12751278
if stderr and isinstance(stderr, bytes):
1276-
stderr = stderr.decode()
1279+
try:
1280+
stderr = stderr.decode()
1281+
except:
1282+
stderr = stderr.decode("ISO-8859-1")
1283+
12771284
result['stdout'] = str(stdout).split('\n')
12781285
result['stderr'] = str(stderr).split('\n')
12791286
result['merged'] = ''

0 commit comments

Comments
 (0)