Skip to content
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

rollback pipenv run behavior to before 2021.11.5 on Windows #4937

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions news/4935.behavior.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pattern expansion for arguments was disabled on Windows.
6 changes: 6 additions & 0 deletions pipenv/cli/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ def show_help(ctx, param, value):
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):
Expand Down
7 changes: 7 additions & 0 deletions tests/integration/test_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

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")
Expand Down Expand Up @@ -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