From 505860789614ad62eacaaea2933f1bbc30b41b9e Mon Sep 17 00:00:00 2001 From: Paul O'Leary McCann Date: Fri, 2 Sep 2022 12:51:26 +0900 Subject: [PATCH] Remove use of split_command in dvc In order to be safe on Windows, this uses string concatenation instead of relying on shlex.split to create a command list. --- spacy/cli/project/dvc.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spacy/cli/project/dvc.py b/spacy/cli/project/dvc.py index 83dc5efbf..15c56a392 100644 --- a/spacy/cli/project/dvc.py +++ b/spacy/cli/project/dvc.py @@ -7,7 +7,7 @@ from wasabi import msg from .._util import PROJECT_FILE, load_project_config, get_hash, project_cli from .._util import Arg, Opt, NAME, COMMAND -from ...util import working_dir, split_command, join_command, run_command +from ...util import working_dir, join_command, run_command from ...util import SimpleFrozenList @@ -144,12 +144,11 @@ def run_dvc_commands( command-line setting while avoiding lots of nested conditionals. """ for c in commands: - command = split_command(c) - dvc_command = ["dvc", *command] + dvc_command = "dvc " + c # Add the flags if they are set to True for flag, is_active in flags.items(): if is_active: - dvc_command.append(flag) + dvc_command += " " + flag run_command(dvc_command)