summaryrefslogtreecommitdiff
path: root/setuptools/command
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-07-22 13:51:38 -0400
committerGitHub <noreply@github.com>2016-07-22 13:51:38 -0400
commit6547430bf289c7285498303ea77eef56702c3a95 (patch)
tree0dacce66723c7a87cafb21739158e44fbe813d37 /setuptools/command
parent0269eaa527744320cdb42600927f9ef11900d4d7 (diff)
parent3132833570c90d52f6c2a422506732e82d772cdd (diff)
downloadpython-setuptools-git-6547430bf289c7285498303ea77eef56702c3a95.tar.gz
Merge pull request #616 from fkrull/issue398
Fix "failed to create process" issue on Windows
Diffstat (limited to 'setuptools/command')
-rwxr-xr-xsetuptools/command/easy_install.py11
-rwxr-xr-xsetuptools/command/install_scripts.py5
2 files changed, 15 insertions, 1 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 468b9be7..19f8286b 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -1987,8 +1987,17 @@ class CommandSpec(list):
return self._render(self + list(self.options))
@staticmethod
+ def _strip_quotes(item):
+ _QUOTES = '"\''
+ for q in _QUOTES:
+ if item.startswith(q) and item.endswith(q):
+ return item[1:-1]
+ return item
+
+ @staticmethod
def _render(items):
- cmdline = subprocess.list2cmdline(items)
+ cmdline = subprocess.list2cmdline(
+ CommandSpec._strip_quotes(item.strip()) for item in items)
return '#!' + cmdline + '\n'
diff --git a/setuptools/command/install_scripts.py b/setuptools/command/install_scripts.py
index be66cb22..16234273 100755
--- a/setuptools/command/install_scripts.py
+++ b/setuptools/command/install_scripts.py
@@ -1,6 +1,7 @@
from distutils import log
import distutils.command.install_scripts as orig
import os
+import sys
from pkg_resources import Distribution, PathMetadata, ensure_directory
@@ -37,6 +38,10 @@ class install_scripts(orig.install_scripts):
if is_wininst:
exec_param = "python.exe"
writer = ei.WindowsScriptWriter
+ if exec_param == sys.executable:
+ # In case the path to the Python executable contains a space, wrap
+ # it so it's not split up.
+ exec_param = [exec_param]
# resolve the writer to the environment
writer = writer.best()
cmd = writer.command_spec_class.best().from_param(exec_param)