amitt001 / delegator.py

Subprocesses for Humans 2.0.
MIT License
1.7k stars 92 forks source link

Only first argument is used #74

Closed jonmcclung closed 5 years ago

jonmcclung commented 5 years ago

I just did pip3 install delegator.py and I cannot get multiple arguments to work. As an example:

import delegator

# as a single argument works fine
delegator.run(['echo hello']).out
# outputs: 'hello\n'

# as multiple arguments seems to only use the first one
delegator.run(['echo', 'hello']).out
# outputs: '\n', expected output: 'hello\n'
tmbull commented 5 years ago

I experienced the same...

frostming commented 5 years ago

Delegator.run passes shell=True flag to Popen, which doesn't accept a list of command.

xrobin commented 4 years ago

This looks like #58.

Note that the readme file says you can pass a list of commands

Commands can be passed in as lists as well (e.g. ``['ls', '-lrt']``), for parameterization.

So the closing reason seems a bit out of place.