delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/01/23/11:09:22

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 23 Jan 2004 11:10:49 -0500
From: Jason Tishler <jason AT tishler DOT net>
To: cygwin AT cygwin DOT com
Subject: Re: Python packaging bug? [Attn: Jason Tishler]
Message-ID: <20040123161048.GM1920@tishler.net>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Pine DOT GSO DOT 4 DOT 56 DOT 0401230912130 DOT 12395 AT slinky DOT cs DOT nyu DOT edu>
Mime-Version: 1.0
In-Reply-To: <Pine.GSO.4.56.0401230912130.12395@slinky.cs.nyu.edu>
User-Agent: Mutt/1.4i
X-IsSubscribed: yes

Igor,

On Fri, Jan 23, 2004 at 09:27:53AM -0500, Igor Pechtchanski wrote:
> I'm not sure if this is a bug (hence the question mark in the subject),
> but the two python scripts in /usr/bin ("idle" and "pydoc") refer to
> /usr/bin/python.exe in their #! line.  Is there a particular reason why
> they don't just use /usr/bin/python?  I know it makes no difference in
> Cygwin, but it might be confusing.

The above is by design:

    def copy_scripts (self):
        """Copy each script listed in 'self.scripts'; if it's marked as
        a Python script in the Unix way (first line matches
        'first_line_re', ie. starts with "\#!" and contains "python"),
        then adjust the first line to refer to the current Python
        interpreter as we copy.
        """
    [snip]
            if adjust:
                log.info("copying and adjusting %s -> %s", script,
                         self.build_dir)
                [snip]
                    else:
                        outf.write("#!%s%s\n" %
                                   (os.path.join(
                            sysconfig.get_config_var("BINDIR"),
                            "python" + sysconfig.get_config_var("EXE")),
                                    post_interp))

Note the reference to EXE above.

> Also, I looked at the Python sources, and the sample scripts there
> contain '#! /usr/bin/env python' (not /usr/bin/python.exe).  I'm
> guessing that this somehow gets changed in setup.py, but don't know
> enough Python to find exactly where this happens.  This "problem" has
> been present since at least python-2.3-2 (maybe earlier).

Python uses the following:

    #! /usr/bin/env python

as its standard trigger line.  In this way, scripts will use the version
of python found on the user's PATH first.  Some like this approach, some
don't.

Do we have too much time on our hands? :,)

Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019