Skip to content

Use shell=False in subprocess Function Calls #1

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

Open
wants to merge 1 commit into
base: jade
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions jade/jade_packing.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,15 +606,15 @@ def build(args):
if len(specify_files) > 0:
if file_name in specify_files:
cmd_str = "{}easycython {}/{}".format(scripts_path, "new_src", file_name)
result = subprocess.run(cmd_str, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
result = subprocess.run(cmd_str, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
progressBar.update()
need_to_build_file_list.append(file_name)
else:
pass
else:
cmd_str = "{}easycython {}/{}".format(scripts_path, "new_src", file_name)
need_to_build_file_list.append(file_name)
subprocess.run(cmd_str, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.run(cmd_str, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
progressBar.update()

build_file_list = os.listdir()
Expand Down Expand Up @@ -840,7 +840,7 @@ def packSetup(args, exec_path, uuid,output_name=None):
print("Inno Setup Path exists,dir:{}".format(inno_setup_path))
cmd_str = "{} {}".format(os.path.join(inno_setup_path, "ISCC.exe"), os.path.join(os.getcwd(), issname))
print("cmd str:{}".format(cmd_str))
subprocess.run(cmd_str, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.run(cmd_str, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
os.remove(os.path.join(os.getcwd(), issname))


Expand Down Expand Up @@ -934,7 +934,7 @@ def packAPP(args):
if "Windows" == getOperationSystem():
if str_to_bool(args.full) is False:
cmd_str = "xcopy dist\\{} {} /s/y".format(get_app_name(args), save_bin_path)
subprocess.run(cmd_str, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
subprocess.run(cmd_str, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
else:
shutil.copy("dist\\{}.exe".format(get_app_name(args)), "{}/".format(save_bin_path))
else:
Expand Down