From 1504d1fffb3f75ed0177820aa37ac53ea4ef7b4e Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Thu, 12 Oct 2017 17:44:40 -0400 Subject: [PATCH] Add fix for windwos paths * Fixes #865 --- pipenv/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pipenv/utils.py b/pipenv/utils.py index 3fea5fab..d7a6d630 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -340,6 +340,9 @@ def shellquote(s): """Prepares a string for the shell (on Windows too!)""" if s is None: return None + # Additional escaping for windows paths + if os.name == 'nt': + s = "{}".format(s.replace("\\", "\\\\")) return '"' + s.replace("'", "'\\''") + '"' @@ -850,8 +853,7 @@ def get_windows_path(*args): """Sanitize a path for windows environments Accepts an arbitrary list of arguments and makes a clean windows path""" - clean_path = os.path.join(*args) - return os.path.normpath(clean_path) + return os.path.normpath(os.path.join(*args)) def find_windows_executable(bin_path, exe_name):