Skip to content

[BUG] STDOUT of CommandLine is stored as one letter per line #3103

@tashrifbillah

Description

@tashrifbillah

Summary

STDOUT from CommandLine interface is stored as one letter per line in Terminal output section of _report/report.rst

Actual behavior

T
h
i
s
i
s
m
y
o
u
t
p
u
t

Expected behavior

This is my output

How to replicate the behavior

cd /tmp
# save test.py and test2.py
export PYTHONPATH=/tmp
python test2.py
vim /tmp/stdoutError/list_content/_report/report.rst

Script/Workflow details

test.py

#!/usr/bin/env python

from nipype.interfaces.base import CommandLine, CommandLineInputSpec, TraitedSpec, Str

# ==================
class LsInputSpec(CommandLineInputSpec):
    in_path= Str(argstr='%s')


class LsOutputSpec(TraitedSpec):
    pass

class Ls(CommandLine):
    _cmd = 'ls'
    input_spec = LsInputSpec
    output_spec = LsOutputSpec

    def _list_outputs(self):
        pass

test2.py

from nipype import Node, Workflow, SelectFiles
from test import Ls

# ==================
parent_directory= '/tmp/'

# ===============
templates= {'path': '/tmp/'}
select_files= Node(SelectFiles(templates), name= 'select_files')

# ===============
stdoutError= Workflow(name='stdoutError', base_dir= parent_directory)

ls_node= Node(Ls(), name='list_content')

stdoutError.connect(select_files, 'path', ls_node, 'in_path')
stdoutError.run()

Platform details:

191119-20:05:34,389 nipype.utils INFO:
         Running nipype version 1.2.3 (latest: 1.3.1)
{'commit_hash': 'a485cf60f',
 'commit_source': 'installation',
 'networkx_version': '2.2',
 'nibabel_version': '2.3.0',
 'nipype_version': '1.2.3',
 'numpy_version': '1.16.2',
 'pkg_path': '/home/tb571/miniconda3/lib/python3.6/site-packages/nipype',
 'scipy_version': '1.2.1',
 'sys_executable': '/home/tb571/miniconda3/bin/python',
 'sys_platform': 'linux',
 'sys_version': '3.6.7 | packaged by conda-forge | (default, Feb 28 2019, '
                '09:07:38) \n'
                '[GCC 7.3.0]',
 'traits_version': '4.6.0'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions