diff --git a/pipenv/patched/pew/pew.py b/pipenv/patched/pew/pew.py index 07dbdf4f37..038ad886bb 100644 --- a/pipenv/patched/pew/pew.py +++ b/pipenv/patched/pew/pew.py @@ -184,7 +184,8 @@ def fork_bash(env, cwd): def fork_cmder(env, cwd): shell_cmd = ['cmd'] - cmderrc_path = r'%CMDER_ROOT%\vendor\init.bat' + escaped_cmder_root = os.environ['CMDER_ROOT'].replace(' ', '^ ') + cmderrc_path = r'{0}\vendor\init.bat'.format(escaped_cmder_root) if expandpath(cmderrc_path).exists(): shell_cmd += ['/k', cmderrc_path] if cwd: diff --git a/tasks/vendoring/patches/patched/pew-cmder-root-space-escape-fix.patch b/tasks/vendoring/patches/patched/pew-cmder-root-space-escape-fix.patch new file mode 100644 index 0000000000..eb0e3d8296 --- /dev/null +++ b/tasks/vendoring/patches/patched/pew-cmder-root-space-escape-fix.patch @@ -0,0 +1,14 @@ +diff --git a/pipenv/patched/pew/pew.py b/pipenv/patched/pew/pew.py +index 2d3889a0..91f313c1 100644 +--- a/pipenv/patched/pew/pew.py ++++ b/pipenv/patched/pew/pew.py +@@ -184,7 +184,8 @@ def fork_bash(env, cwd): + + def fork_cmder(env, cwd): + shell_cmd = ['cmd'] +- cmderrc_path = r'%CMDER_ROOT%\vendor\init.bat' ++ escaped_cmder_root = os.environ['CMDER_ROOT'].replace(' ', '^ ') ++ cmderrc_path = r'{0}\vendor\init.bat'.format(escaped_cmder_root) + if expandpath(cmderrc_path).exists(): + shell_cmd += ['/k', cmderrc_path] + if cwd: