[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-distutils-sig
Subject:    Re: [Distutils] easy_install adds bad interpreter shebang
From:       "Phillip J. Eby" <pje () telecommunity ! com>
Date:       2008-12-20 1:16:03
Message-ID: 20081220011553.0CEBC3A40F7 () sparrow ! telecommunity ! com
[Download RAW message or body]

At 01:33 AM 12/19/2008 -0600, Ian Bicking wrote:
>Tres Seaver wrote:
>>I would way rather see that kind of solution than using 'env':  scripts
>>installed by easy_install should *not* use whatever python happens to be
>>found at the moment on PATH.
>
>I agree that's necessary, but I don't think anyone has been 
>proposing that (well, except the initial proposal).  I'm guessing 
>the script in this case could look like:
>
>#!/bin/sh
>exec "path/to/python" -c "everything that would normally be in the 
>body of the script"

Actually, I was thinking more like:

#!/bin/sh
# standard easy_install comment lines here
""":"
exec '/path/to/python' "$0" "$@"
"""
# rest of the code here

The idea being to preserve the inspectable info that easy_install 
puts in the first few lines of script comments.  And of course, to 
properly pass through sys.argv, etc.  The path to sys.executable also 
needs to be properly escaped by the code writing the script.

_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic