Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tox drops double quotes from executed commands output, making them confusing #845

Closed
ssbarnea opened this issue Jun 12, 2018 · 3 comments
Closed
Labels
bug:normal affects many people or has quite an impact level:medium rought estimate that this might be neither easy nor hard to implement

Comments

@ssbarnea
Copy link
Member

Apparently when tox prints the executed commands it does not keep them in their original form and drops the double quotes, making them really confusing and invalid.

Content in tox.ini:

commands =
        bash -c "git ls-tree --full-tree --name-only -r HEAD plugins | grep -E '\.ya?ml$' | xargs -I FILE -n1 -P 4 ansible-lint --force-color -q -p -x $SKIPPED FILE"

Sample output:

ansible-lint runtests: commands[1] | bash -c git ls-tree --full-tree --name-only -r HEAD plugins | grep -E '\.ya?ml$' | xargs -I FILE -n1 -P 4 ansible-lint --force-color -q -p -x $SKIPPED FILE

As you can see the quotes that mark the bash command to be executed are lost, so if anyone tries to copy/paste the command, it will fail to run because what is printed on screen is invalid.

@gaborbernat gaborbernat added the bug:normal affects many people or has quite an impact label Jun 12, 2018
@gaborbernat
Copy link
Member

Yeah, we need to fix that somehow. One thing mind you in general commands need to run both under Windows and Linux; so AFAIK we do some sanitizing on them. Will double check.

@gaborbernat gaborbernat added the level:medium rought estimate that this might be neither easy nor hard to implement label Jun 12, 2018
@asottile
Copy link
Contributor

probably somewhere we're doing ' '.join(...) and we need to ' '.join(pipes.quote(p) for p in ...)

@asottile
Copy link
Contributor

found the place: #848

@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug:normal affects many people or has quite an impact level:medium rought estimate that this might be neither easy nor hard to implement
Projects
None yet
Development

No branches or pull requests

3 participants