Skip to content

Don't use shell to run vagrant subprocess - #112

Merged
apatard merged 1 commit into
pycontribs:mainfrom
apatard:shell_removal
Mar 30, 2022
Merged

Don't use shell to run vagrant subprocess#112
apatard merged 1 commit into
pycontribs:mainfrom
apatard:shell_removal

Conversation

@apatard

@apatard apatard commented Mar 30, 2022

Copy link
Copy Markdown
Collaborator

There's no need to have an overhead of a shell and it's often
considered bad practice, so convert all subprocess calls to
not use a shell.

Signed-off-by: Arnaud Patard apatard@hupstream.com

@konstruktoid konstruktoid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we ensure a shell isn't used by setting shell=False?
i know it's the default, but just to be on the safe side?

@apatard

apatard commented Mar 30, 2022

Copy link
Copy Markdown
Collaborator Author

should we ensure a shell isn't used by setting shell=False? i know it's the default, but just to be on the safe side?

That's indeed a good question. I was relying on the default value, but yeah, the default can always be changed later.
I don't have any problem adding it. @ssbarnea ? what's your opinion ?

@konstruktoid konstruktoid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer shell=False, but otherwise lgtm

@ssbarnea ssbarnea changed the title tests/test_vagrant.py: Don't use shell to run vagrant Don't use shell to run vagrant subprocess Mar 30, 2022
@ssbarnea ssbarnea added the bug label Mar 30, 2022
@ssbarnea

Copy link
Copy Markdown
Member

@apatard please rebase and merge once passing.

There's no need to have an overhead of a shell and it's often
considered bad practice, so convert all subprocess calls to
not use a shell.

Signed-off-by: Arnaud Patard <apatard@hupstream.com>
@apatard
apatard merged commit 86933da into pycontribs:main Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants