diff --git a/docs/changelog/1660.bugfix.rst b/docs/changelog/1660.bugfix.rst new file mode 100644 index 000000000..0fe88ac04 --- /dev/null +++ b/docs/changelog/1660.bugfix.rst @@ -0,0 +1 @@ +Fix creation of entry points when path contains spaces - by :user:`nsoranzo`. diff --git a/src/virtualenv/seed/via_app_data/pip_install/base.py b/src/virtualenv/seed/via_app_data/pip_install/base.py index 42855748f..8baec674b 100644 --- a/src/virtualenv/seed/via_app_data/pip_install/base.py +++ b/src/virtualenv/seed/via_app_data/pip_install/base.py @@ -130,13 +130,13 @@ def _console_scripts(self): def _create_console_entry_point(self, name, value, to_folder, version_info): result = [] - from distlib.scripts import ScriptMaker + from distlib.scripts import _enquote_executable, ScriptMaker maker = ScriptMaker(None, str(to_folder)) maker.clobber = True # overwrite maker.variants = {""} maker.set_mode = True # ensure they are executable - maker.executable = str(self._creator.exe) + maker.executable = _enquote_executable(str(self._creator.exe)) specification = "{} = {}".format(name, value) with self.patch_distlib_correct_variants(version_info, maker): new_files = maker.make(specification)