From c1dced60c1ab8c60b56a26d9d231772574508d0c Mon Sep 17 00:00:00 2001 From: Jesse Braham Date: Mon, 23 Jan 2017 19:33:18 -0800 Subject: [PATCH 1/2] Fixes issue of failing with spaces in path --- pipenv/cli.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index 43aa179f..ff1a9657 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -238,10 +238,12 @@ def activate_virtualenv(source=True): if 'csh' in os.environ['SHELL']: suffix = '.csh' + venv_location = project.virtualenv_location.replace(' ', '\\ ') + if source: - return 'source {0}/bin/activate{1}'.format(project.virtualenv_location, suffix) + return 'source {0}/bin/activate{1}'.format(venv_location, suffix) else: - return '{0}/bin/activate'.format(project.virtualenv_location) + return '{0}/bin/activate'.format(venv_location) def do_activate_virtualenv(bare=False): From fa349f6c4ae4210b58d335bbd91f60a20d1586e0 Mon Sep 17 00:00:00 2001 From: Jesse Braham Date: Wed, 25 Jan 2017 17:39:23 -0800 Subject: [PATCH 2/2] Remove accidental duplicate backslash, add comment --- pipenv/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index ff1a9657..a799e718 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -238,7 +238,9 @@ def activate_virtualenv(source=True): if 'csh' in os.environ['SHELL']: suffix = '.csh' - venv_location = project.virtualenv_location.replace(' ', '\\ ') + # Escape any spaces located within the virtualenv path to allow + # for proper activation. + venv_location = project.virtualenv_location.replace(' ', '\ ') if source: return 'source {0}/bin/activate{1}'.format(venv_location, suffix)