Skip to content

Commit a3aa3b5

Browse files
committed
Quote filename and specifiers to avoid paths with wierd characters
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
1 parent cd5e598 commit a3aa3b5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/test_cli.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,16 @@ def run_cli(options, cli=resolve_dependencies, expected_rc=0, env=None, get_env=
525525
runner = CliRunner()
526526
if get_env:
527527
options = get_os_and_pyver(options)
528+
529+
# Wrapping the options in quotes to handle paths with spaces or any weird characters
530+
prev = None
531+
for index, option in enumerate(options):
532+
if not prev:
533+
prev = option
534+
continue
535+
if prev in ["--requirement", "--setup-py", "--specifier", "--json", "--json-pdt"]:
536+
options[index] = f'"{option}"'
537+
528538
result = runner.invoke(cli, options, catch_exceptions=False, env=env)
529539

530540
if result.exit_code != expected_rc:

0 commit comments

Comments
 (0)