mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-08 14:14:57 +03:00
Use shlex.join in run_command
Previously the command string was built by joining with a space, which wouldn't work for anything requiring quotes. The command string built this way is only used for debugging purposes, but shlex.join will be always be valid on Linux, and will usually be valid in Windows. It's unclear how to do better on Windows.
This commit is contained in:
parent
2fe360d7f3
commit
a53735f018
|
@ -972,7 +972,9 @@ def run_command(
|
||||||
cmd_str = command
|
cmd_str = command
|
||||||
else:
|
else:
|
||||||
cmd_list = command
|
cmd_list = command
|
||||||
cmd_str = " ".join(command)
|
# As above, this will usually but not always be correct on Windows, but
|
||||||
|
# is only used for debugging purposes.
|
||||||
|
cmd_str = shlex.join(command)
|
||||||
try:
|
try:
|
||||||
cmd_to_run = command if is_windows else cmd_list
|
cmd_to_run = command if is_windows else cmd_list
|
||||||
ret = subprocess.run(
|
ret = subprocess.run(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user