Pattern expansion for arguments was disabled on Windows

Fix #4937.
This commit is contained in:
pinfort
2022-01-30 03:38:26 +09:00
committed by Oz N Tiram
parent 30a9b93262
commit b60d37a859
3 changed files with 14 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
Pattern expansion for arguments was disabled on Windows.
+6
View File
@@ -46,6 +46,12 @@ class PipenvGroup(DYMMixin, Group):
help="Show this message and exit.",
)
def main(self, *args, **kwargs):
"""
to specify the windows_expand_args option to avoid exceptions on Windows
see: https://github.com/pallets/click/issues/1901
"""
return super().main(*args, **kwargs, windows_expand_args=False)
class State:
def __init__(self):
+7
View File
@@ -3,6 +3,7 @@ from pathlib import Path
import pytest
from pipenv.utils import subprocess_run
# This module is run only on Windows.
pytestmark = pytest.mark.skipif(os.name != 'nt', reason="only relevant on windows")
@@ -78,3 +79,9 @@ def test_pipenv_clean_windows(PipenvInstance):
c = p.pipenv('clean --dry-run')
assert c.returncode == 0
assert 'click' in c.stdout.strip()
@pytest.mark.cli
def test_pipenv_run_with_special_chars_windows(PipenvInstance):
with PipenvInstance():
c = subprocess_run(["pipenv", "run", "echo", "[3-1]"])
assert c.returncode == 0, c.stderr