[Distutils] easy_install adds bad interpreter shebang to installed scripts

Felix Schwarz felix.schwarz at web.de
Wed Dec 17 18:15:09 CET 2008


Hi *,

I'm using Python 2.5 on Fedora Linux 9. If the path to the interpreter 
contains spaces and I install some eggs with scripts using easy_install, 
all installed scripts will have a non-functional shebang line like this:
#!"/home/foo bar/bin/python"

On Linux (and I think this is true for all Un*x flavors) you can not 
quote the shebang path and there is no way around this [1].

To make it more clear where the problem is I attached some kind of 
'patch'. My idea was that quoting shebang paths seem to work on Windows 
(at least this was my impression from reading the changelogs) but on 
Linux there is no way to generate a working shebang line with an 
absolute path. Therefore it would help me if /usr/bin/env is queried.

Probably this will break for some people but currently the behavior is 
broken for everyone. With virtualenv you have to call activate (instead 
of calling the installed script directly) but then everything will work 
fine.

Do you consider this a kind of bug you might be inclined to fix?
fs

[1] 
http://groups.google.com/group/gnu.bash.bug/browse_thread/thread/861a98e53be305c3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spaces.patch
Type: text/x-patch
Size: 770 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20081217/9143928d/attachment.bin>


More information about the Distutils-SIG mailing list