Skip to content

Use of import-from means shell=True goes undetected. #50

@stephenpaulger

Description

@stephenpaulger

shell=True is not flagged as problematic when the function is imported with from subprocess import.

Two functionally equivalent python files, I would expect equivalent results.

# shell_true_import_from.py
from subprocess import call

call("echo hello", shell=True)
# shell_true_import_subprocess.py
import subprocess

subprocess.call("echo hello", shell=True)

Unfortunately, only one file is detected as problematic.

% flake8
./shell_true_import_subprocess.py:3:1: SCS103 use of `shell=True` in subprocess functions or use of functions that internally set it should be avoided

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions