Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions nipype/interfaces/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ def read(self, drain=0):
def _read(self, drain):
"Read from the file descriptor"
fd = self.fileno()
buf = os.read(fd, 4096).decode(self.default_encoding)
buf = os.read(fd, 4096).decode(self.default_encoding, errors='backslashreplace')
if not buf and not self._buf:
return None
if '\n' not in buf:
Expand Down Expand Up @@ -1507,8 +1507,8 @@ def _process(drain=0):
proc.poll()
time.sleep(interval)
stdout, stderr = proc.communicate()
stdout = stdout.decode(default_encoding)
stderr = stderr.decode(default_encoding)
stdout = stdout.decode(default_encoding, errors='backslashreplace')
stderr = stderr.decode(default_encoding, errors='backslashreplace')
result['stdout'] = stdout.split('\n')
result['stderr'] = stderr.split('\n')
result['merged'] = ''
Expand All @@ -1522,8 +1522,8 @@ def _process(drain=0):
ret_code = proc.wait()
stderr.flush()
stdout.flush()
result['stdout'] = [line.decode(default_encoding).strip() for line in open(outfile, 'rb').readlines()]
result['stderr'] = [line.decode(default_encoding).strip() for line in open(errfile, 'rb').readlines()]
result['stdout'] = [line.decode(default_encoding, errors='backslashreplace').strip() for line in open(outfile, 'rb').readlines()]
result['stderr'] = [line.decode(default_encoding, errors='backslashreplace').strip() for line in open(errfile, 'rb').readlines()]
result['merged'] = ''
if output == 'none':
if runtime_profile:
Expand Down Expand Up @@ -1677,7 +1677,7 @@ def cmdline(self):
return ' '.join(allargs)

def raise_exception(self, runtime):
raise RuntimeError(
raise RuntimeError(
('Command:\n{cmdline}\nStandard output:\n{stdout}\n'
'Standard error:\n{stderr}\nReturn code: {returncode}').format(
**runtime.dictcopy()))
Expand Down
3 changes: 1 addition & 2 deletions nipype/interfaces/mrtrix3/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,10 @@ class ResponseSD(MRTrix3Base):
>>> resp.inputs.in_mask = 'mask.nii.gz'
>>> resp.inputs.grad_fsl = ('bvecs', 'bvals')
>>> resp.cmdline # doctest: +ELLIPSIS +IGNORE_UNICODE
'dwi2response -fslgrad bvecs bvals -mask mask.nii.gz dwi.mif response.txt'
>>> resp.run() # doctest: +SKIP
"""

_cmd = 'dwi2response'
_cmd = 'dwi2response tax'
input_spec = ResponseSDInputSpec
output_spec = ResponseSDOutputSpec

Expand Down