Skip to content

Commit

Permalink
Fixes path issue in Windows exe launchers
Browse files Browse the repository at this point in the history
Using spaces in Windows is common. This patch fixes an issue in the exe launch
wrappers generated in the "Scripts" directory where unnecessary quoting causes
the following error.

Fatal error in launcher: Unable to create process using '""C:\Program Files (x86)\Cloudbase    Solutions\OpenStack\Nova\Python27\python.exe"" "C:\Program Files (x86)\Cloudbase Solutions\OpenStack\Nova\Python27\Scripts\nova.exe" '

Closes issue: pypa#1997
  • Loading branch information
alexpilotti committed Aug 28, 2014
1 parent 673b7c3 commit de97f64
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions pip/_vendor/distlib/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def _get_alternate_executable(self, executable, options):
return executable

def _get_shebang(self, encoding, post_interp=b'', options=None):
enquote = True
if self.executable:
executable = self.executable
enquote = False # assume this will be taken care of
Expand All @@ -109,10 +108,6 @@ def _get_shebang(self, encoding, post_interp=b'', options=None):
if options:
executable = self._get_alternate_executable(executable, options)

# If the user didn't specify an executable, it may be necessary to
# cater for executable paths with spaces (not uncommon on Windows)
if enquote and ' ' in executable:
executable = '"%s"' % executable
executable = fsencode(executable)
shebang = b'#!' + executable + post_interp + b'\n'
# Python parser starts to read a script using UTF-8 until
Expand Down

1 comment on commit de97f64

@HaoHoo
Copy link

@HaoHoo HaoHoo commented on de97f64 Apr 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still happened on Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32 at Windows 10.

Please sign in to comment.