From d3513ee3826b34d49c59b105e68f40f79bf031c2 Mon Sep 17 00:00:00 2001 From: David Noetzel Date: Mon, 25 Jun 2018 14:40:55 -0500 Subject: [PATCH] Allow virtual env creation in dir with leading dash Invoke pew with a double dash separator ("--"), to make it clear that the virtualenv name is a positional argument. Since the virtualenv name includes all or at least the beginning of the directory name, trying to create a virtualenv in a directory with a leading dash in its name will cause pew to erroneously parse the virtualenv name as an optional argument. Adding the separator causes the virtualenv name to be parsed correctly. Fixes #439 --- pipenv/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipenv/core.py b/pipenv/core.py index d97e89a7..ea56cbe2 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -914,7 +914,6 @@ def do_create_virtualenv(python=None, site_packages=False): '-m', 'pipenv.pew', 'new', - project.virtualenv_name, '-d', '-a', project.project_directory, @@ -932,6 +931,8 @@ def do_create_virtualenv(python=None, site_packages=False): err=True, ) cmd = cmd + ['-p', python] + if not project.is_venv_in_project(): + cmd = cmd + ['--', project.virtualenv_name] # Actually create the virtualenv. with spinner(): try: