Skip to content

Use shlex.quote/shlex.join to construct cmdlines #851

@effigies

Description

@effigies

After spending an annoying amount of time figuring out @yarikoptic's problem in nipype with dcm2niix failing if a directory had a space in it, I have discovered that it cannot be properly fixed without substantially breaking nipype, as some argstrs rely on not getting quoted.

I would suggest that pydra commit to constructing command lines as lists of arguments that are joined with shlex.join, and use shlex.split when pieces (singularity run) need splitting. shlex.quote is also useful at times, but probably not as much having a clear notion of when you are working with a list of arguments and when you are working with a command line that could be passed to a shell.

It will take a bit of working out and bug fixing, but perhaps we can avoid turning those bugs into load-bearing bugs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions